Skip to content

Commit

Permalink
Merge branch 'master' into 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathansant committed Oct 26, 2023
2 parents 310d02b + 2296602 commit e8e33b8
Show file tree
Hide file tree
Showing 26 changed files with 139 additions and 242 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## [2.0.0](https://github.com/jonathansant/orleans.persistence.redis/compare/1.5.0...2.0.0) (2023-02-21)
## [2.2.0](https://github.com/jonathansant/orleans.persistence.redis/compare/2.1.0...2.2.0) (2023-10-25)

### Features

- update Orleans version to 7.2.2

## [2.0.0](https://github.com/jonathansant/orleans.persistence.redis/compare/1.5.0...2.0.0) (2023-02-21)

### Features

Expand Down
2 changes: 1 addition & 1 deletion DeflateCompressionTest/DeflateCompressionTest.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
29 changes: 12 additions & 17 deletions Orleans.Persistence.Redis.E2E/JsonSerializationTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Extensions.Configuration;
using System;
using Microsoft.Extensions.Configuration;
using Orleans.Hosting;
using Orleans.Streams;
using Orleans.TestingHost;
Expand All @@ -25,7 +26,7 @@ public async Task ActivateGrainWithState()
var done = new TaskCompletionSource<bool>();

var provider = Cluster.Client.GetStreamProvider("TestStream");
var stream = provider.GetStream<string>(Consts.StreamGuid, "deactivate-notifications");
var stream = provider.GetStream<string>("deactivate-notifications", Consts.StreamGuid);
await stream.SubscribeAsync((message, seq) =>
{
done.SetResult(true);
Expand All @@ -45,17 +46,14 @@ public class ClientBuilderConfigurator : IClientBuilderConfigurator
{
public virtual void Configure(IConfiguration configuration, IClientBuilder clientBuilder)
=> clientBuilder
.ConfigureApplicationParts(parts => parts.AddApplicationPart(typeof(ITestGrain).Assembly).WithReferences())
.AddSimpleMessageStreamProvider("TestStream")
.AddMemoryStreams("TestStream")
;
}

public class SiloBuilderConfigurator : ISiloBuilderConfigurator
public class SiloBuilderConfigurator : ISiloConfigurator
{
public void Configure(ISiloHostBuilder hostBuilder)
public void Configure(ISiloBuilder hostBuilder)
=> hostBuilder
.ConfigureApplicationParts(parts =>
parts.AddApplicationPart(typeof(ITestGrain).Assembly).WithReferences())
.AddRedisGrainStorage("TestingProvider")
.AddRedisDefaultHumanReadableSerializer()
.Build(builder => builder.Configure(opts =>
Expand All @@ -66,7 +64,7 @@ public void Configure(ISiloHostBuilder hostBuilder)
opts.KeyPrefix = "prefix-json";
})
)
.AddSimpleMessageStreamProvider("TestStream")
.AddMemoryStreams("TestStream")
.AddMemoryGrainStorage("PubSubStore")
;
}
Expand All @@ -86,7 +84,7 @@ public async Task PubSub()
await grain.Invoke();

var provider = Cluster.Client.GetStreamProvider("TestStream");
var stream = provider.GetStream<int>(Consts.StreamGuid, "multi-notifications");
var stream = provider.GetStream<int>("multi-notifications", Consts.StreamGuid);

for (var i = 0; i < 10; i++)
{
Expand All @@ -104,17 +102,14 @@ public class ClientBuilderConfigurator : IClientBuilderConfigurator
{
public virtual void Configure(IConfiguration configuration, IClientBuilder clientBuilder)
=> clientBuilder
.ConfigureApplicationParts(parts => parts.AddApplicationPart(typeof(ITestGrain).Assembly).WithReferences())
.AddSimpleMessageStreamProvider("TestStream")
.AddMemoryStreams("TestStream")
;
}

public class SiloBuilderConfigurator : ISiloBuilderConfigurator
public class SiloBuilderConfigurator : ISiloConfigurator
{
public void Configure(ISiloHostBuilder hostBuilder)
public void Configure(ISiloBuilder hostBuilder)
=> hostBuilder
.ConfigureApplicationParts(parts =>
parts.AddApplicationPart(typeof(ITestGrain).Assembly).WithReferences())
.AddRedisGrainStorage("TestingProvider")
.AddRedisDefaultHumanReadableSerializer()
.Build(builder => builder.Configure(opts =>
Expand All @@ -133,7 +128,7 @@ public void Configure(ISiloHostBuilder hostBuilder)
opts.HumanReadableSerialization = true;
opts.KeyPrefix = "prefix-json-pubsub";
}))
.AddSimpleMessageStreamProvider("TestStream")
.AddMemoryStreams("TestStream")
;
}
}
Expand Down
13 changes: 5 additions & 8 deletions Orleans.Persistence.Redis.E2E/MessagePackTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public async Task ActivateGrainWithState()
var done = new TaskCompletionSource<bool>();

var provider = Cluster.Client.GetStreamProvider("TestStream");
var stream = provider.GetStream<string>(Consts.StreamGuid, "deactivate-notifications");
var stream = provider.GetStream<string>("deactivate-notifications", Consts.StreamGuid);
await stream.SubscribeAsync((message, seq) =>
{
done.SetResult(true);
Expand All @@ -46,17 +46,14 @@ public class ClientBuilderConfigurator : IClientBuilderConfigurator
{
public virtual void Configure(IConfiguration configuration, IClientBuilder clientBuilder)
=> clientBuilder
.ConfigureApplicationParts(parts => parts.AddApplicationPart(typeof(ITestGrain).Assembly).WithReferences())
.AddSimpleMessageStreamProvider("TestStream")
.AddMemoryStreams("TestStream")
;
}

public class SiloBuilderConfigurator : ISiloBuilderConfigurator
public class SiloBuilderConfigurator : ISiloConfigurator
{
public void Configure(ISiloHostBuilder hostBuilder)
public void Configure(ISiloBuilder hostBuilder)
=> hostBuilder
.ConfigureApplicationParts(parts =>
parts.AddApplicationPart(typeof(ITestGrain).Assembly).WithReferences())
.AddRedisGrainStorage("TestingProvider")
.AddRedisSerializer<MessagePackSerializer>()
.Build(builder => builder.Configure(opts =>
Expand All @@ -65,7 +62,7 @@ public void Configure(ISiloHostBuilder hostBuilder)
opts.ClientName = "testing";
})
)
.AddSimpleMessageStreamProvider("TestStream")
.AddMemoryStreams("TestStream")
.AddMemoryGrainStorage("PubSubStore")
;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net7.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Humanizer.Core" Version="2.14.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="Microsoft.Orleans.CodeGenerator.MSBuild" Version="3.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Orleans.Core" Version="3.2.0" />
<PackageReference Include="Microsoft.Orleans.OrleansProviders" Version="3.2.0" />
<PackageReference Include="Microsoft.Orleans.TestingHost" Version="3.2.0" />
<PackageReference Include="Microsoft.Orleans.Sdk" Version="7.2.2" />
<PackageReference Include="Microsoft.Orleans.Server" Version="7.2.2" />
<PackageReference Include="Microsoft.Orleans.TestingHost" Version="7.2.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public async Task Test()
}
}

public class RedisSegmentTests<T> : TestBase<T, SiloConfigurator.ClientBuilderConfigurator> where T : ISiloBuilderConfigurator, new()
public class RedisSegmentTests<T> : TestBase<T, SiloConfigurator.ClientBuilderConfigurator> where T : ISiloConfigurator, new()
{
private readonly ITestOutputHelper _output;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
using Orleans.Providers;
using System.Threading;
using Orleans.Providers;
using System.Threading.Tasks;

namespace Orleans.Persistence.Redis.E2E.RedisSegmentTests
{
[GenerateSerializer]
public class BigData
{
[Id(0)]
public string Data { get; set; }
}

Expand All @@ -18,7 +21,7 @@ public interface ITestGrainSegments : IGrainWithStringKey
[StorageProvider(ProviderName = "TestingProvider")]
public class TestGrainSegments : Grain<BigData>, ITestGrainSegments
{
public override async Task OnActivateAsync()
public override async Task OnActivateAsync(CancellationToken _)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@

namespace Orleans.Persistence.Redis.E2E.RedisSegmentTests.SiloConfigurator
{
public class SiloBuilderConfiguratorOrleansSerializer : ISiloBuilderConfigurator
public class SiloBuilderConfiguratorOrleansSerializer : ISiloConfigurator
{
public void Configure(ISiloHostBuilder hostBuilder)
public void Configure(ISiloBuilder hostBuilder)
=> hostBuilder
.ConfigureApplicationParts(parts =>
parts.AddApplicationPart(typeof(ITestGrainSegments).Assembly).WithReferences())
.AddRedisGrainStorage("TestingProvider")
.Build(builder => builder.Configure(opts =>
{
Expand All @@ -22,12 +20,10 @@ public void Configure(ISiloHostBuilder hostBuilder)
}))
;
}
public class SiloBuilderConfiguratorOrleansSerializerCompressed : ISiloBuilderConfigurator
public class SiloBuilderConfiguratorOrleansSerializerCompressed : ISiloConfigurator
{
public void Configure(ISiloHostBuilder hostBuilder)
public void Configure(ISiloBuilder hostBuilder)
=> hostBuilder
.ConfigureApplicationParts(parts =>
parts.AddApplicationPart(typeof(ITestGrainSegments).Assembly).WithReferences())
.AddRedisGrainStorage("TestingProvider")
.AddDefaultRedisBrotliSerializer()
.Build(builder => builder.Configure(opts =>
Expand All @@ -38,12 +34,10 @@ public void Configure(ISiloHostBuilder hostBuilder)
}))
;
}
public class SiloBuilderConfiguratorOrleansSerializerDeflateCompression : ISiloBuilderConfigurator
public class SiloBuilderConfiguratorOrleansSerializerDeflateCompression : ISiloConfigurator
{
public void Configure(ISiloHostBuilder hostBuilder)
public void Configure(ISiloBuilder hostBuilder)
=> hostBuilder
.ConfigureApplicationParts(parts =>
parts.AddApplicationPart(typeof(ITestGrainSegments).Assembly).WithReferences())
.AddRedisGrainStorage("TestingProvider")
.AddRedisSerializer<DeflateSerializer>()
.Build(builder => builder.Configure(opts =>
Expand All @@ -55,12 +49,10 @@ public void Configure(ISiloHostBuilder hostBuilder)
;
}

public class SiloBuilderConfiguratorOrleansSerializerSegmented : ISiloBuilderConfigurator
public class SiloBuilderConfiguratorOrleansSerializerSegmented : ISiloConfigurator
{
public void Configure(ISiloHostBuilder hostBuilder)
public void Configure(ISiloBuilder hostBuilder)
=> hostBuilder
.ConfigureApplicationParts(parts =>
parts.AddApplicationPart(typeof(ITestGrainSegments).Assembly).WithReferences())
.AddRedisGrainStorage("TestingProvider")
.Build(builder => builder.Configure(opts =>
{
Expand All @@ -72,12 +64,10 @@ public void Configure(ISiloHostBuilder hostBuilder)
;
}

public class SiloBuilderConfiguratorOrleansSerializerCompressedSegmented : ISiloBuilderConfigurator
public class SiloBuilderConfiguratorOrleansSerializerCompressedSegmented : ISiloConfigurator
{
public void Configure(ISiloHostBuilder hostBuilder)
public void Configure(ISiloBuilder hostBuilder)
=> hostBuilder
.ConfigureApplicationParts(parts =>
parts.AddApplicationPart(typeof(ITestGrainSegments).Assembly).WithReferences())
.AddRedisGrainStorage("TestingProvider")
.AddDefaultRedisBrotliSerializer()
.Build(builder => builder.Configure(opts =>
Expand All @@ -90,12 +80,10 @@ public void Configure(ISiloHostBuilder hostBuilder)
;
}

public class SiloBuilderConfiguratorOrleansSerializerDeflateCompressionSegmented : ISiloBuilderConfigurator
public class SiloBuilderConfiguratorOrleansSerializerDeflateCompressionSegmented : ISiloConfigurator
{
public void Configure(ISiloHostBuilder hostBuilder)
public void Configure(ISiloBuilder hostBuilder)
=> hostBuilder
.ConfigureApplicationParts(parts =>
parts.AddApplicationPart(typeof(ITestGrainSegments).Assembly).WithReferences())
.AddRedisGrainStorage("TestingProvider")
.AddRedisSerializer<DeflateSerializer>()
.Build(builder => builder.Configure(opts =>
Expand All @@ -108,12 +96,10 @@ public void Configure(ISiloHostBuilder hostBuilder)
;
}

public class SiloBuilderConfiguratorHumanSerializer : ISiloBuilderConfigurator
public class SiloBuilderConfiguratorHumanSerializer : ISiloConfigurator
{
public void Configure(ISiloHostBuilder hostBuilder)
public void Configure(ISiloBuilder hostBuilder)
=> hostBuilder
.ConfigureApplicationParts(parts =>
parts.AddApplicationPart(typeof(ITestGrainSegments).Assembly).WithReferences())
.AddRedisGrainStorage("TestingProvider")
.Build(builder => builder.Configure(opts =>
{
Expand All @@ -125,12 +111,10 @@ public void Configure(ISiloHostBuilder hostBuilder)
;
}

public class SiloBuilderConfiguratorHumanSerializerSegmented : ISiloBuilderConfigurator
public class SiloBuilderConfiguratorHumanSerializerSegmented : ISiloConfigurator
{
public void Configure(ISiloHostBuilder hostBuilder)
public void Configure(ISiloBuilder hostBuilder)
=> hostBuilder
.ConfigureApplicationParts(parts =>
parts.AddApplicationPart(typeof(ITestGrainSegments).Assembly).WithReferences())
.AddRedisGrainStorage("TestingProvider")
.Build(builder => builder.Configure(opts =>
{
Expand All @@ -143,12 +127,10 @@ public void Configure(ISiloHostBuilder hostBuilder)
;
}

public class SiloBuilderConfiguratorHumanSerializerCompressed : ISiloBuilderConfigurator
public class SiloBuilderConfiguratorHumanSerializerCompressed : ISiloConfigurator
{
public void Configure(ISiloHostBuilder hostBuilder)
public void Configure(ISiloBuilder hostBuilder)
=> hostBuilder
.ConfigureApplicationParts(parts =>
parts.AddApplicationPart(typeof(ITestGrainSegments).Assembly).WithReferences())
.AddRedisGrainStorage("TestingProvider")
.AddCompression<Compression.RawDeflateCompression>()
//.AddCompression<Compression.BrotliCompression>()
Expand All @@ -163,12 +145,10 @@ public void Configure(ISiloHostBuilder hostBuilder)
}));
}

public class SiloBuilderConfiguratorHumanSerializerCompressedWithSegments : ISiloBuilderConfigurator
public class SiloBuilderConfiguratorHumanSerializerCompressedWithSegments : ISiloConfigurator
{
public void Configure(ISiloHostBuilder hostBuilder)
public void Configure(ISiloBuilder hostBuilder)
=> hostBuilder
.ConfigureApplicationParts(parts =>
parts.AddApplicationPart(typeof(ITestGrainSegments).Assembly).WithReferences())
.AddRedisGrainStorage("TestingProvider")
.AddCompression<Compression.RawDeflateCompression>()
//.AddCompression<Compression.BrotliCompression>()
Expand All @@ -188,8 +168,7 @@ public class ClientBuilderConfigurator : IClientBuilderConfigurator
{
public virtual void Configure(IConfiguration configuration, IClientBuilder clientBuilder)
=> clientBuilder
.ConfigureApplicationParts(parts => parts.AddApplicationPart(typeof(ITestGrain).Assembly).WithReferences())
.AddSimpleMessageStreamProvider("TestStream")
.AddMemoryStreams("TestStream")
;
}
}
4 changes: 2 additions & 2 deletions Orleans.Persistence.Redis.E2E/RedisTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public async Task ActivateGrainWithState()
var done = new TaskCompletionSource<bool>();

var provider = Cluster.Client.GetStreamProvider("TestStream");
var stream = provider.GetStream<string>(Consts.StreamGuid, "deactivate-notifications");
var stream = provider.GetStream<string>("deactivate-notifications", Consts.StreamGuid);
await stream.SubscribeAsync((message, seq) =>
{
done.SetResult(true);
Expand Down Expand Up @@ -61,7 +61,7 @@ public async Task ClearState()
var done = new TaskCompletionSource<bool>();

var provider = Cluster.Client.GetStreamProvider("TestStream");
var stream = provider.GetStream<string>(Consts.StreamGuid, "deactivate-notifications");
var stream = provider.GetStream<string>("deactivate-notifications", Consts.StreamGuid);
await stream.SubscribeAsync((message, seq) =>
{
done.SetResult(true);
Expand Down
Loading

0 comments on commit e8e33b8

Please sign in to comment.