-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Realization of Persistence Query for InMemory Read Journal (#6409)
* Started with InMemoryReadJournal. * Update API Verify list * Update csproj to use common.props and xunitsettings.props * ICurrentEventsByPersistenceIdQuery and IEventsByPersistenceIdQuery has been implemented for InMemoryReadJournal. * ICurrentEventsByTagQuery and IEventsByTagQuery has been implemented. * ICurrentAllEventsQuery and IAllEventsQuery has been implemented. * IPersistenceIds has been implemented. * Filesystem dependent test has been fixed. * Style and documentation fix. * Moved from long to int part 1. * Moved from long to int part 2. * Move from long to int part 3. * Refactoring. * Refactoring. * Update API Verify list * Revert changes to TCK and fix unit tests * Remove obsolete query messages * Update Akka.Persistence.Query.InMemory.Tests.csproj --------- Co-authored-by: Gregorius Soedharmo <arkatufus@yahoo.com> Co-authored-by: Aaron Stannard <aaron@petabridge.com>
- Loading branch information
1 parent
149cc05
commit d703632
Showing
29 changed files
with
2,311 additions
and
5 deletions.
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
23 changes: 23 additions & 0 deletions
23
...stence/Akka.Persistence.Query.InMemory.Tests/Akka.Persistence.Query.InMemory.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,23 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<Import Project="..\..\..\common.props" /> | ||
<Import Project="..\..\..\xunitSettings.props" /> | ||
|
||
<PropertyGroup> | ||
<AssemblyTitle>Akka.Persistence.Query.InMemory.Tests</AssemblyTitle> | ||
<TargetFrameworks>$(NetFrameworkTestVersion);$(NetCoreTestVersion);$(NetTestVersion)</TargetFrameworks> | ||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\..\core\Akka.Persistence.TCK\Akka.Persistence.TCK.csproj" /> | ||
<ProjectReference Include="..\Akka.Persistence.Query.InMemory\Akka.Persistence.Query.InMemory.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" /> | ||
<PackageReference Include="xunit" Version="$(XunitVersion)" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" /> | ||
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsVersion)" /> | ||
</ItemGroup> | ||
|
||
</Project> |
28 changes: 28 additions & 0 deletions
28
src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryAllEventsSpec.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,28 @@ | ||
// //----------------------------------------------------------------------- | ||
// // <copyright file="InMemoryAllEventsSpec.cs" company="Akka.NET Project"> | ||
// // Copyright (C) 2009-2023 Lightbend Inc. <http://www.lightbend.com> | ||
// // Copyright (C) 2013-2023 .NET Foundation <https://github.com/akkadotnet/akka.net> | ||
// // </copyright> | ||
// //----------------------------------------------------------------------- | ||
|
||
using Akka.Configuration; | ||
using Akka.Persistence.TCK.Query; | ||
using Xunit.Abstractions; | ||
|
||
namespace Akka.Persistence.Query.InMemory.Tests | ||
{ | ||
public class InMemoryAllEventsSpec : AllEventsSpec | ||
{ | ||
private static Config Config() => ConfigurationFactory.ParseString($@" | ||
akka.loglevel = INFO | ||
akka.persistence.query.journal.inmem.refresh-interval = 1s | ||
akka.persistence.journal.plugin = ""akka.persistence.journal.inmem"" | ||
akka.persistence.snapshot-store.plugin = ""akka.persistence.snapshot-store.inmem""") | ||
.WithFallback(InMemoryReadJournal.DefaultConfiguration()); | ||
|
||
public InMemoryAllEventsSpec(ITestOutputHelper output) : base(Config(), nameof(InMemoryAllEventsSpec), output) | ||
{ | ||
ReadJournal = Sys.ReadJournalFor<InMemoryReadJournal>(InMemoryReadJournal.Identifier); | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryCurrentAllEventsSpec.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,28 @@ | ||
// //----------------------------------------------------------------------- | ||
// // <copyright file="InMemoryCurrentAllEventsSpec.cs" company="Akka.NET Project"> | ||
// // Copyright (C) 2009-2023 Lightbend Inc. <http://www.lightbend.com> | ||
// // Copyright (C) 2013-2023 .NET Foundation <https://github.com/akkadotnet/akka.net> | ||
// // </copyright> | ||
// //----------------------------------------------------------------------- | ||
|
||
using Akka.Configuration; | ||
using Akka.Persistence.TCK.Query; | ||
using Xunit.Abstractions; | ||
|
||
namespace Akka.Persistence.Query.InMemory.Tests | ||
{ | ||
public class InMemoryCurrentAllEventsSpec : CurrentAllEventsSpec | ||
{ | ||
private static Config Config() => ConfigurationFactory.ParseString($@" | ||
akka.loglevel = INFO | ||
akka.persistence.query.journal.inmem.refresh-interval = 1s | ||
akka.persistence.journal.plugin = ""akka.persistence.journal.inmem"" | ||
akka.persistence.snapshot-store.plugin = ""akka.persistence.snapshot-store.inmem""") | ||
.WithFallback(InMemoryReadJournal.DefaultConfiguration()); | ||
|
||
public InMemoryCurrentAllEventsSpec(ITestOutputHelper output) : base(Config(), nameof(InMemoryCurrentAllEventsSpec), output) | ||
{ | ||
ReadJournal = Sys.ReadJournalFor<InMemoryReadJournal>(InMemoryReadJournal.Identifier); | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...istence/Akka.Persistence.Query.InMemory.Tests/InMemoryCurrentEventsByPersistenceIdSpec.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,28 @@ | ||
// //----------------------------------------------------------------------- | ||
// // <copyright file="InMemoryCurrentEventsByPersistenceIdSpec.cs" company="Akka.NET Project"> | ||
// // Copyright (C) 2009-2023 Lightbend Inc. <http://www.lightbend.com> | ||
// // Copyright (C) 2013-2023 .NET Foundation <https://github.com/akkadotnet/akka.net> | ||
// // </copyright> | ||
// //----------------------------------------------------------------------- | ||
|
||
using Akka.Configuration; | ||
using Akka.Persistence.TCK.Query; | ||
using Xunit.Abstractions; | ||
|
||
namespace Akka.Persistence.Query.InMemory.Tests | ||
{ | ||
public class InMemoryCurrentEventsByPersistenceIdSpec : CurrentEventsByPersistenceIdSpec | ||
{ | ||
private static Config Config() => ConfigurationFactory.ParseString($@" | ||
akka.loglevel = INFO | ||
akka.persistence.journal.plugin = ""akka.persistence.journal.inmem"" | ||
akka.persistence.snapshot-store.plugin = ""akka.persistence.snapshot-store.inmem""") | ||
.WithFallback(InMemoryReadJournal.DefaultConfiguration()); | ||
|
||
public InMemoryCurrentEventsByPersistenceIdSpec(ITestOutputHelper output) : | ||
base(Config(), nameof(InMemoryCurrentPersistenceIdsSpec), output) | ||
{ | ||
ReadJournal = Sys.ReadJournalFor<InMemoryReadJournal>(InMemoryReadJournal.Identifier); | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...ntrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryCurrentEventsByTagSpec.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,36 @@ | ||
// //----------------------------------------------------------------------- | ||
// // <copyright file="InMemoryCurrentEventsByTagSpec.cs" company="Akka.NET Project"> | ||
// // Copyright (C) 2009-2023 Lightbend Inc. <http://www.lightbend.com> | ||
// // Copyright (C) 2013-2023 .NET Foundation <https://github.com/akkadotnet/akka.net> | ||
// // </copyright> | ||
// //----------------------------------------------------------------------- | ||
|
||
using Akka.Configuration; | ||
using Akka.Persistence.TCK.Query; | ||
using Xunit.Abstractions; | ||
|
||
namespace Akka.Persistence.Query.InMemory.Tests | ||
{ | ||
public class InMemoryCurrentEventsByTagSpec : CurrentEventsByTagSpec | ||
{ | ||
private static Config Config() => ConfigurationFactory.ParseString($@" | ||
akka.loglevel = INFO | ||
akka.persistence.journal.plugin = ""akka.persistence.journal.inmem"" | ||
akka.persistence.snapshot-store.plugin = ""akka.persistence.snapshot-store.inmem"" | ||
akka.persistence.journal.inmem {{ | ||
event-adapters {{ | ||
color-tagger = ""Akka.Persistence.TCK.Query.ColorFruitTagger, Akka.Persistence.TCK"" | ||
}} | ||
event-adapter-bindings = {{ | ||
""System.String"" = color-tagger | ||
}} | ||
}}") | ||
.WithFallback(InMemoryReadJournal.DefaultConfiguration()); | ||
|
||
public InMemoryCurrentEventsByTagSpec(ITestOutputHelper output) : | ||
base(Config(), nameof(InMemoryCurrentPersistenceIdsSpec), output) | ||
{ | ||
ReadJournal = Sys.ReadJournalFor<InMemoryReadJournal>(InMemoryReadJournal.Identifier); | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...ib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryCurrentPersistenceIdsSpec.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,28 @@ | ||
// //----------------------------------------------------------------------- | ||
// // <copyright file="InMemoryCurrentPersistenceIdsSpec.cs" company="Akka.NET Project"> | ||
// // Copyright (C) 2009-2023 Lightbend Inc. <http://www.lightbend.com> | ||
// // Copyright (C) 2013-2023 .NET Foundation <https://github.com/akkadotnet/akka.net> | ||
// // </copyright> | ||
// //----------------------------------------------------------------------- | ||
|
||
using Akka.Configuration; | ||
using Akka.Persistence.TCK.Query; | ||
using Xunit.Abstractions; | ||
|
||
namespace Akka.Persistence.Query.InMemory.Tests | ||
{ | ||
public class InMemoryCurrentPersistenceIdsSpec : CurrentPersistenceIdsSpec | ||
{ | ||
private static Config Config() => ConfigurationFactory.ParseString($@" | ||
akka.loglevel = INFO | ||
akka.persistence.journal.plugin = ""akka.persistence.journal.inmem"" | ||
akka.persistence.snapshot-store.plugin = ""akka.persistence.snapshot-store.inmem""") | ||
.WithFallback(InMemoryReadJournal.DefaultConfiguration()); | ||
|
||
public InMemoryCurrentPersistenceIdsSpec(ITestOutputHelper output) : | ||
base(Config(), nameof(InMemoryCurrentPersistenceIdsSpec), output) | ||
{ | ||
ReadJournal = Sys.ReadJournalFor<InMemoryReadJournal>(InMemoryReadJournal.Identifier); | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...ib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryEventsByPersistenceIdSpec.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 file="InMemoryEventsByPersistenceIdSpec.cs" company="Akka.NET Project"> | ||
// // Copyright (C) 2009-2023 Lightbend Inc. <http://www.lightbend.com> | ||
// // Copyright (C) 2013-2023 .NET Foundation <https://github.com/akkadotnet/akka.net> | ||
// // </copyright> | ||
// //----------------------------------------------------------------------- | ||
|
||
using Akka.Configuration; | ||
using Akka.Persistence.TCK.Query; | ||
using Xunit.Abstractions; | ||
|
||
namespace Akka.Persistence.Query.InMemory.Tests | ||
{ | ||
public class InMemoryEventsByPersistenceIdSpec : EventsByPersistenceIdSpec | ||
{ | ||
private static Config Config() => ConfigurationFactory.ParseString($@" | ||
akka.loglevel = INFO | ||
akka.persistence.query.journal.inmem.refresh-interval = 1s | ||
akka.persistence.journal.plugin = ""akka.persistence.journal.inmem"" | ||
akka.persistence.snapshot-store.plugin = ""akka.persistence.snapshot-store.inmem""") | ||
.WithFallback(InMemoryReadJournal.DefaultConfiguration()); | ||
|
||
public InMemoryEventsByPersistenceIdSpec(ITestOutputHelper output) : | ||
base(Config(), nameof(InMemoryCurrentPersistenceIdsSpec), output) | ||
{ | ||
ReadJournal = Sys.ReadJournalFor<InMemoryReadJournal>(InMemoryReadJournal.Identifier); | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryEventsByTagSpec.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,36 @@ | ||
// //----------------------------------------------------------------------- | ||
// // <copyright file="InMemoryEventsByTagSpec.cs" company="Akka.NET Project"> | ||
// // Copyright (C) 2009-2023 Lightbend Inc. <http://www.lightbend.com> | ||
// // Copyright (C) 2013-2023 .NET Foundation <https://github.com/akkadotnet/akka.net> | ||
// // </copyright> | ||
// //----------------------------------------------------------------------- | ||
|
||
using Akka.Configuration; | ||
using Akka.Persistence.TCK.Query; | ||
using Xunit.Abstractions; | ||
|
||
namespace Akka.Persistence.Query.InMemory.Tests | ||
{ | ||
public class InMemoryEventsByTagSpec : EventsByTagSpec | ||
{ | ||
private static Config Config() => ConfigurationFactory.ParseString($@" | ||
akka.loglevel = INFO | ||
akka.persistence.journal.plugin = ""akka.persistence.journal.inmem"" | ||
akka.persistence.snapshot-store.plugin = ""akka.persistence.snapshot-store.inmem"" | ||
akka.persistence.journal.inmem {{ | ||
event-adapters {{ | ||
color-tagger = ""Akka.Persistence.TCK.Query.ColorFruitTagger, Akka.Persistence.TCK"" | ||
}} | ||
event-adapter-bindings = {{ | ||
""System.String"" = color-tagger | ||
}} | ||
}}") | ||
.WithFallback(InMemoryReadJournal.DefaultConfiguration()); | ||
|
||
public InMemoryEventsByTagSpec(ITestOutputHelper output) : | ||
base(Config(), nameof(InMemoryCurrentPersistenceIdsSpec), output) | ||
{ | ||
ReadJournal = Sys.ReadJournalFor<InMemoryReadJournal>(InMemoryReadJournal.Identifier); | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryPersistenceIdsSpec.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,30 @@ | ||
// //----------------------------------------------------------------------- | ||
// // <copyright file="InMemoryPersistenceIdsSpec.cs" company="Akka.NET Project"> | ||
// // Copyright (C) 2009-2023 Lightbend Inc. <http://www.lightbend.com> | ||
// // Copyright (C) 2013-2023 .NET Foundation <https://github.com/akkadotnet/akka.net> | ||
// // </copyright> | ||
// //----------------------------------------------------------------------- | ||
|
||
using System; | ||
using Akka.Configuration; | ||
using Akka.Persistence.TCK.Query; | ||
using Xunit.Abstractions; | ||
|
||
namespace Akka.Persistence.Query.InMemory.Tests | ||
{ | ||
public class InMemoryPersistenceIdsSpec : PersistenceIdsSpec | ||
{ | ||
private static Config Config() => ConfigurationFactory.ParseString($@" | ||
akka.loglevel = INFO | ||
akka.persistence.query.journal.inmem.refresh-interval = 1s | ||
akka.persistence.journal.plugin = ""akka.persistence.journal.inmem"" | ||
akka.persistence.snapshot-store.plugin = ""akka.persistence.snapshot-store.inmem""") | ||
.WithFallback(InMemoryReadJournal.DefaultConfiguration()); | ||
|
||
|
||
public InMemoryPersistenceIdsSpec(ITestOutputHelper output) : base(Config(), nameof(InMemoryPersistenceIdsSpec), output) | ||
{ | ||
ReadJournal = Sys.ReadJournalFor<InMemoryReadJournal>(InMemoryReadJournal.Identifier); | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...ontrib/persistence/Akka.Persistence.Query.InMemory/Akka.Persistence.Query.InMemory.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,24 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<Import Project="..\..\..\common.props" /> | ||
|
||
<PropertyGroup> | ||
<AssemblyTitle>Akka.Persistence.Query.InMemory</AssemblyTitle> | ||
<Description>Akka.NET Persistence Query implementation for InMemory Journal.</Description> | ||
<TargetFrameworks>$(NetStandardLibVersion);$(NetLibVersion)</TargetFrameworks> | ||
<PackageTags>$(AkkaPackageTags);persistence;eventsource;sql;reactive;streams</PackageTags> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\..\core\Akka.Persistence.Query\Akka.Persistence.Query.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<EmbeddedResource Include="reference.conf" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> | ||
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants> | ||
</PropertyGroup> | ||
|
||
</Project> |
Oops, something went wrong.