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

Bump Arcane.Framework to v0.0.39 #54

Merged
merged 3 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/Arcane.Stream.SqlServerChangeTracking.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Arcane.Framework" Version="0.0.37" />
<PackageReference Include="Arcane.Framework" Version="0.0.39" />
</ItemGroup>

</Project>
31 changes: 12 additions & 19 deletions src/Models/SqlServerChangeTrackingStreamContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Arcane.Framework.Configuration;
using Arcane.Framework.Services.Base;
using Arcane.Framework.Services.Models;
using Arcane.Framework.Sinks.Extensions;
using Arcane.Framework.Sinks.Models;

namespace Arcane.Stream.SqlServerChangeTracking.Models;
Expand Down Expand Up @@ -77,29 +78,21 @@ public class SqlServerChangeTrackingStreamContext : IStreamContext, IStreamConte
/// Property to hold stream metadata received from the stream context.
/// </summary>
[JsonPropertyName("streamMetadata")]
public StreamMetadataDefinition StreamMetadataProperty { get; set; }
public StreamMetadataDefinition StreamMetadata { get; set; }

/// <inheritdoc cref="IStreamContext.StreamMetadata"/>
[JsonIgnore]
public Option<StreamMetadata> StreamMetadata
/// <inheritdoc cref="Framework.Sinks.Models.StreamMetadata"/>
public Option<StreamMetadata> GetStreamMetadata()
{
get
if (this.StreamMetadata is null)
{
if (this.StreamMetadataProperty is null)
{
return Option<StreamMetadata>.None;
}

var partitions = this.StreamMetadataProperty
.Partitions
.Select(partition => new StreamPartition
{
Name = partition.Name,
FieldName = partition.FieldName,
FieldFormat = partition.FieldFormat
}).ToArray();
return new StreamMetadata(partitions);
return Option<StreamMetadata>.None;
}

var partitions = this.StreamMetadata
.Partitions
.Select(partition => partition.ToStreamPartition())
.ToArray();
return new StreamMetadata(partitions);
}

/// <inheritdoc cref="IStreamContextWriter.SetStreamId"/>
Expand Down
2 changes: 1 addition & 1 deletion src/Services/SqlServerChangeTrackgingGraphBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ILogger<SqlServerChangeTrackingGraphBuilder> logger
createSchemaFile: true,
dataSinkPathSegment: context.IsBackfilling ? "backfill" : "data",
dropCompletionToken: context.IsBackfilling,
streamMetadata: context.StreamMetadata.GetOrElse(new StreamMetadata(Option<StreamPartition[]>.None)));
streamMetadata: context.GetStreamMetadata().GetOrElse(new StreamMetadata(Option<StreamPartition[]>.None)));

return Source
.FromGraph(source)
Expand Down
Loading