diff --git a/CDP4Common/CDP4Common.csproj b/CDP4Common/CDP4Common.csproj index ac05277d..6fd7ac8f 100644 --- a/CDP4Common/CDP4Common.csproj +++ b/CDP4Common/CDP4Common.csproj @@ -4,7 +4,7 @@ net48;netstandard2.0 Starion Group S.A. CDP4Common Community Edition - 27.4.0 + 27.4.1 CDP4 Common Class Library that contains DTOs, POCOs Copyright © Starion Group S.A. Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathanael, Ahmed @@ -20,7 +20,7 @@ CDP COMET ECSS-E-TM-10-25 LGPL-3.0-only - [ADD] SharpZipLibExtension Methods + [BUMP] Version to 27.4.1 README.md diff --git a/CDP4Dal.Tests/AssemblerTestFixture.cs b/CDP4Dal.Tests/AssemblerTestFixture.cs index 407da987..b9949dc5 100644 --- a/CDP4Dal.Tests/AssemblerTestFixture.cs +++ b/CDP4Dal.Tests/AssemblerTestFixture.cs @@ -26,6 +26,7 @@ namespace CDP4Dal.Tests { using System; using System.Collections.Generic; + using System.Diagnostics; using System.Linq; using System.Threading.Tasks; @@ -191,6 +192,59 @@ public async Task AssertThatAssemblerSynchronizationWorks() Assert.That(assembler.Cache.TryGetValue(new CacheKey(categoryToRemove.Iid, null), out lazyCat), Is.False); } + [Test] + public async Task AssertThatAssemblerSynchronizationWorksFastEnough() + { + var assembler = new Assembler(this.uri, this.messageBus); + + var domain = new Dto.DomainOfExpertise(Guid.NewGuid(), 1); + this.testInput.Add(domain); + + for (var i = 0; i < 20000; i++) + { + this.testInput.Add(new Dto.ElementDefinition(Guid.NewGuid(), 1) {Owner = domain.Iid}); + } + + var sw = new Stopwatch(); + + sw.Reset(); + sw.Start(); + + // 1st call of Synnchronize + await assembler.Synchronize(this.testInput); + + sw.Stop(); + var elapsed = sw.Elapsed; + await TestContext.Progress.WriteLineAsync($"First synchronize took {elapsed}"); + // Modification of the input Dtos + Assert.That(assembler.Cache, Is.Not.Empty); + Assert.That(this.testInput.Count, Is.EqualTo(assembler.Cache.Count)); + + sw.Reset(); + sw.Start(); + + // 1st call of Synnchronize + await assembler.Synchronize(this.testInput); + + sw.Stop(); + elapsed = sw.Elapsed; + await TestContext.Progress.WriteLineAsync($"Second synchronize took {elapsed}"); + Assert.That(assembler.Cache, Is.Not.Empty); + Assert.That(this.testInput.Count, Is.EqualTo(assembler.Cache.Count)); + + sw.Reset(); + sw.Start(); + + // 1st call of Synnchronize + await assembler.Synchronize(this.testInput); + + sw.Stop(); + elapsed = sw.Elapsed; + await TestContext.Progress.WriteLineAsync($"Third synchronize took {elapsed}"); + Assert.That(assembler.Cache, Is.Not.Empty); + Assert.That(this.testInput.Count, Is.EqualTo(assembler.Cache.Count)); + } + [Test] public async Task AssertThatRevisionsAreCachedCorrectly() { diff --git a/CDP4Dal/Assembler.cs b/CDP4Dal/Assembler.cs index c96136dc..5b855584 100644 --- a/CDP4Dal/Assembler.cs +++ b/CDP4Dal/Assembler.cs @@ -143,9 +143,7 @@ public async Task Synchronize(IEnumerable dtoThings, bool logger.Info("Start Synchronization of {0}", this.IDalUri); var existentGuid = - this.Cache.Select( - x => new Tuple(x.Value.Value.CacheKey, x.Value.Value.RevisionNumber)) - .ToList(); + new Dictionary(this.Cache.ToDictionary(x => x.Value.Value.CacheKey, y => y.Value.Value.RevisionNumber)); this.CheckPartitionDependentContainmentContainerIds(dtoThings); @@ -224,17 +222,14 @@ public async Task Synchronize(IEnumerable dtoThings, bool if (succeed) { var thingObject = updatedLazyThing.Value; - var cacheId = new CacheKey(dtoThing.Iid, dtoThing.IterationContainerId); - - if (!existentGuid.Select(x => x.Item1).Contains(cacheId)) + + if (!existentGuid.TryGetValue(cacheKey, out var cacheThingRevisionNumber)) { this.messageBus.SendObjectChangeEvent(thingObject, EventKind.Added); messageCounter++; } else { - var cacheThingRevisionNumber = existentGuid.Single(x => x.Item1.Equals(cacheId)).Item2; - if (dtoThing.RevisionNumber > cacheThingRevisionNumber) { // send event if revision number has increased from the old cached version @@ -243,7 +238,7 @@ public async Task Synchronize(IEnumerable dtoThings, bool } else if (dtoThing.RevisionNumber < cacheThingRevisionNumber) { - if (this.Cache.TryGetValue(cacheId, out var cacheThing)) + if (this.Cache.TryGetValue(cacheKey, out var cacheThing)) { // send event if revision number is lower. That means that the original cached item was changed (revision was added!) ICDPMessageBus.Current.SendObjectChangeEvent(cacheThing.Value, EventKind.Updated); this.messageBus.SendObjectChangeEvent(cacheThing.Value, EventKind.Updated); diff --git a/CDP4Dal/CDP4Dal.csproj b/CDP4Dal/CDP4Dal.csproj index cc693e52..bd0ddb22 100644 --- a/CDP4Dal/CDP4Dal.csproj +++ b/CDP4Dal/CDP4Dal.csproj @@ -4,7 +4,7 @@ net48;netstandard2.0 Starion Group S.A. CDP4Dal Community Edition - 27.4.0 + 27.4.1 CDP4 Data Access Layer library, a consumer of an ECSS-E-TM-10-25 Annex C API Copyright © Starion Group S.A. Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathanael, Ahmed @@ -20,7 +20,7 @@ CDP COMET ECSS-E-TM-10-25 LGPL-3.0-only - [BUMP] To CDP4Common 27.4.0 + [REFACTOR] Assembler performance README.md diff --git a/CDP4DalCommon/CDP4DalCommon.csproj b/CDP4DalCommon/CDP4DalCommon.csproj index 65793335..c2f010fe 100644 --- a/CDP4DalCommon/CDP4DalCommon.csproj +++ b/CDP4DalCommon/CDP4DalCommon.csproj @@ -5,7 +5,7 @@ Starion Group S.A. latest CDP4DalCommon Community Edition - 27.4.0 + 27.4.1 CDP4 Common Class Library that contains common types for any CDP4 server and the CDP4Dal Copyright © Starion Group S.A. Sam, Alex, Alexander, Nathanael, Antoine, Omar, Jaime @@ -21,7 +21,7 @@ CDP COMET ECSS-E-TM-10-25 LGPL-3.0-only - [BUMP] To CDP4Common 27.4.0 + [BUMP] To CDP4Common 27.4.1 README.md true diff --git a/CDP4JsonFileDal/CDP4JsonFileDal.csproj b/CDP4JsonFileDal/CDP4JsonFileDal.csproj index 3b71d367..fdb3d2df 100644 --- a/CDP4JsonFileDal/CDP4JsonFileDal.csproj +++ b/CDP4JsonFileDal/CDP4JsonFileDal.csproj @@ -4,7 +4,7 @@ net48;netstandard2.0 Starion Group S.A. CDP4JsonFileDal Community Edition - 27.4.0 + 27.4.1 CDP4 Json File Dal Plugin Copyright © Starion Group S.A. Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathanael diff --git a/CDP4JsonSerializer/CDP4JsonSerializer.csproj b/CDP4JsonSerializer/CDP4JsonSerializer.csproj index e962e55d..73cef7f1 100644 --- a/CDP4JsonSerializer/CDP4JsonSerializer.csproj +++ b/CDP4JsonSerializer/CDP4JsonSerializer.csproj @@ -4,7 +4,7 @@ net48;netstandard2.0 Starion Group S.A. CDP4JsonSerializer Community Edition - 27.4.0 + 27.4.1 CDP4 JSON Serialization Library Copyright © Starion Group S.A. Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathanael @@ -20,7 +20,7 @@ CDP COMET ECSS-E-TM-10-25 JSON LGPL-3.0-only - [BUMP] To CDP4Common 27.4.0 + [BUMP] To CDP4Common 27.4.1 README.md diff --git a/CDP4MessagePackSerializer/CDP4MessagePackSerializer.csproj b/CDP4MessagePackSerializer/CDP4MessagePackSerializer.csproj index b1e8cf8a..7da9cbb6 100644 --- a/CDP4MessagePackSerializer/CDP4MessagePackSerializer.csproj +++ b/CDP4MessagePackSerializer/CDP4MessagePackSerializer.csproj @@ -4,7 +4,7 @@ net48;netstandard2.0 Starion Group S.A. CDP4MessagePackSerializer Community Edition - 27.4.0 + 27.4.1 CDP4 MessagePack Serialization Library Copyright © Starion Group S.A. Sam, Alex, Alexander, Nathanael, Antoine, Omar @@ -20,8 +20,7 @@ CDP COMET ECSS-E-TM-10-25 MessagePack LGPL-3.0-only - [BUMP] To CDP4Common 27.4.0 - [Update] To MessagePack 2.5.187 + [BUMP] To CDP4Common 27.4.1 README.md diff --git a/CDP4Reporting/CDP4Reporting.csproj b/CDP4Reporting/CDP4Reporting.csproj index 687103b2..ec9fe7f1 100644 --- a/CDP4Reporting/CDP4Reporting.csproj +++ b/CDP4Reporting/CDP4Reporting.csproj @@ -4,7 +4,7 @@ netstandard2.0 Starion Group S.A. CDP4Reporting Community Edition - 27.4.0 + 27.4.1 CDP4 Reporting Copyright © Starion Group S.A. Sam, Alex, Alexander @@ -20,7 +20,7 @@ CDP COMET ECSS-E-TM-10-25 LGPL-3.0-only - [BUMP] To CDP4Common 27.4.0 + [BUMP] To CDP4Common 27.4.1 latest README.md diff --git a/CDP4RequirementsVerification/CDP4RequirementsVerification.csproj b/CDP4RequirementsVerification/CDP4RequirementsVerification.csproj index 8427ceea..36a4b92e 100644 --- a/CDP4RequirementsVerification/CDP4RequirementsVerification.csproj +++ b/CDP4RequirementsVerification/CDP4RequirementsVerification.csproj @@ -4,7 +4,7 @@ net48;netstandard2.0 Starion Group S.A. CDP4RequirementsVerification Community Edition - 27.4.0 + 27.4.1 CDP4 Class Library that provides requirement verification Copyright © Starion Group S.A. Sam, Alex, Alexander, Yevhen, Nathanael @@ -20,7 +20,7 @@ CDP COMET ECSS-E-TM-10-25 LGPL-3.0-only - [BUMP] To CDP4Common 27.4.0 + [BUMP] To CDP4Common 27.4.1 README.md diff --git a/CDP4Rules/CDP4Rules.csproj b/CDP4Rules/CDP4Rules.csproj index ad35b2c5..9e35392b 100644 --- a/CDP4Rules/CDP4Rules.csproj +++ b/CDP4Rules/CDP4Rules.csproj @@ -4,7 +4,7 @@ net48;netstandard2.0 Starion Group S.A. CDP4Rules Community Edition - 27.4.0 + 27.4.1 CDP4 Class Library that provides Model Analysis and Rule Checking Copyright © Starion Group S.A. Sam, Alex, Alexander, Yevhen, Nathanael @@ -20,7 +20,7 @@ CDP COMET ECSS-E-TM-10-25 LGPL-3.0-only - [BUMP] To CDP4Common 27.4.0 + [BUMP] To CDP4Common 27.4.1 README.md diff --git a/CDP4ServicesDal/CDP4ServicesDal.csproj b/CDP4ServicesDal/CDP4ServicesDal.csproj index d75880e1..55323f51 100644 --- a/CDP4ServicesDal/CDP4ServicesDal.csproj +++ b/CDP4ServicesDal/CDP4ServicesDal.csproj @@ -4,7 +4,7 @@ net48;netstandard2.0 Starion Group S.A. CDP4ServicesDal Community Edition - 27.4.0 + 27.4.1 CDP4ServicesDal Dal Plugin Copyright © Starion Group S.A. Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathanael @@ -20,7 +20,7 @@ CDP COMET ECSS-E-TM-10-25 LGPL-3.0-only - [BUMP] To CDP4Common 27.4.0 + [BUMP] To CDP4Common 27.4.1 README.md diff --git a/CDP4ServicesMessaging/CDP4ServicesMessaging.csproj b/CDP4ServicesMessaging/CDP4ServicesMessaging.csproj index b8bb41d1..08a52aee 100644 --- a/CDP4ServicesMessaging/CDP4ServicesMessaging.csproj +++ b/CDP4ServicesMessaging/CDP4ServicesMessaging.csproj @@ -4,7 +4,7 @@ netstandard2.0 Starion Group S.A. CDP4Common Community Edition - 27.4.0 + 27.4.1 CDP4 Services Messaging is a Class Library that contains clients and messages class that can be used for inter services communication Copyright © Starion Group S.A. Sam, Alex, Alexander, Nathanael, Antoine @@ -20,7 +20,7 @@ CDP COMET ECSS-E-TM-10-25 LGPL-3.0-only - [BUMP] To CDP4Common 27.4.0 + [BUMP] To CDP4Common 27.4.1 README.md latest diff --git a/CDP4Web/CDP4Web.csproj b/CDP4Web/CDP4Web.csproj index d81e648c..c8157345 100644 --- a/CDP4Web/CDP4Web.csproj +++ b/CDP4Web/CDP4Web.csproj @@ -5,7 +5,7 @@ latest Starion Group S.A. CDP4Web Community Edition - 27.4.0 + 27.4.1 CDP4Web Dedicated Sdk for CDPServicesDal Copyright © Starion Group S.A. Sam, Alex, Alexander, Nathanael, Antoine, Omar, Jaime @@ -21,7 +21,7 @@ CDP COMET ECSS-E-TM-10-25 LGPL-3.0-only - [BUMP] To CDP4Common 27.4.0 + [BUMP] To CDP4Common 27.4.1 [Update] to Microsoft.Extensions.Logging.Abstractions 8.0.2 README.md diff --git a/CDP4WspDal/CDP4WspDal.csproj b/CDP4WspDal/CDP4WspDal.csproj index 19325e3d..02a22eaa 100644 --- a/CDP4WspDal/CDP4WspDal.csproj +++ b/CDP4WspDal/CDP4WspDal.csproj @@ -4,7 +4,7 @@ net48;netstandard2.0 Starion Group S.A. CDP4WspDal Community Edition - 27.4.0 + 27.4.1 CDP4 WSP Dal Plugin Copyright © Starion Group S.A. Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathanael @@ -20,7 +20,7 @@ CDP COMET ECSS-E-TM-10-25 LGPL-3.0-only - [BUMP] To CDP4Common 27.4.0 + [BUMP] To CDP4Common 27.4.1 README.md diff --git a/pre-release.bat b/pre-release.bat index 512ad271..fa4c872b 100644 --- a/pre-release.bat +++ b/pre-release.bat @@ -44,7 +44,7 @@ ECHO. for %%f in (%~dp0PreReleaseBuilds\*.nupkg) do ( (Echo "%%f" | FIND /I "symbols" 1>NUL) || ( echo Pushing %%f - dotnet nuget push "%%f" --source https://nuget.pkg.github.com/RHEAGROUP/index.json -k %apikey% + dotnet nuget push "%%f" --source https://nuget.pkg.github.com/STARIONGROUP/index.json -k %apikey% ) )