Skip to content
Open
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 Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<NoWarn>$(NoWarn);FS2003;NU5105;NU5104</NoWarn>
<PinnedBaseVersion Condition=" '$(Configuration)' == 'Release' ">3.0.0</PinnedBaseVersion>
<PinnedBaselineRootPackage Condition=" '$(Configuration)' == 'Release' ">[$(PinnedBaseVersion), 4.0.0)</PinnedBaselineRootPackage>
<PinnedDynamoStoreRootPackage Condition=" '$(Configuration)' == 'Release' ">[$(PinnedBaseVersion), 4.0.0)</PinnedDynamoStoreRootPackage>
<!-- <PinnedDynamoStoreRootPackage Condition=" '$(Configuration)' == 'Release' ">[$(PinnedBaseVersion), 4.0.0)</PinnedDynamoStoreRootPackage>-->
</PropertyGroup>
<ItemGroup>
<!-- SourceLink etc -->
Expand Down
11 changes: 6 additions & 5 deletions src/Propulsion.DynamoStore.Indexer/Handler.fs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module Propulsion.DynamoStore.Indexer.Handler

open Amazon.DynamoDBStreams
open Amazon.DynamoDBv2
open Propulsion.DynamoStore

Expand All @@ -8,15 +9,15 @@ let private parse (log: Serilog.ILogger) (dynamoEvent: Amazon.Lambda.DynamoDBEve
let mutable indexStream, systemStreams, noEvents = 0, 0, 0
try for record in dynamoEvent.Records do
match record.Dynamodb.StreamViewType with
| x when x = StreamViewType.NEW_IMAGE || x = StreamViewType.NEW_AND_OLD_IMAGES -> ()
| x when x = string StreamViewType.NEW_IMAGE || x = string StreamViewType.NEW_AND_OLD_IMAGES -> ()
| x -> invalidOp $"Unexpected StreamViewType {x}"

summary.Append(record.EventName.Value[0]) |> ignore
summary.Append(record.EventName) |> ignore

let updated = record.Dynamodb.NewImage
match record.EventName with
| ot when ot = OperationType.REMOVE -> ()
| ot when ot = OperationType.INSERT || ot = OperationType.MODIFY ->
| ot when ot = string OperationType.REMOVE -> ()
| ot when ot = string OperationType.INSERT || ot = string OperationType.MODIFY ->
let p = record.Dynamodb.Keys["p"].S
let sn, n = IndexStreamId.ofP p, int64 updated["n"].N
if p.StartsWith AppendsEpoch.Stream.Category || p.StartsWith AppendsIndex.Stream.Category then indexStream <- indexStream + 1
Expand All @@ -40,7 +41,7 @@ let private parse (log: Serilog.ILogger) (dynamoEvent: Amazon.Lambda.DynamoDBEve
| [| et |] -> ":" + et
| xs -> $":%s{xs[0]}+%d{xs.Length - 1}"
summary.Append(p).Append(et).Append(if i = 0 then " " else $"@%d{i} ") |> ignore
| et -> invalidOp $"Unknown OperationType %s{et.Value}"
| et -> invalidOp $"Unknown OperationType %s{et}"
let spans = spans.ToArray()
log.Information("Index {indexCount} System {systemCount} NoEvents {noEventCount} Spans {spanCount} {summary}",
indexStream, systemStreams, noEvents, spans.Length, summary)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@

<ItemGroup>
<PackageReference Include="MinVer" Version="5.0.0" PrivateAssets="All" />

<PackageReference Include="Amazon.Lambda.Core" Version="2.1.0" />
<PackageReference Include="Amazon.Lambda.DynamoDBEvents" Version="2.1.1" />
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.3.0" />

<PackageReference Include="Amazon.Lambda.Core" Version="2.8.1" />
<PackageReference Include="Amazon.Lambda.DynamoDBEvents" Version="3.1.2" />
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.5" />
<PackageReference Include="AWSSDK.DynamoDBStreams" Version="4.0.4.14" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
<ProjectReference Condition=" '$(PinnedDynamoStoreRootPackage)' == '' " Include="..\Propulsion.DynamoStore\Propulsion.DynamoStore.fsproj" />
<PackageReference Condition=" '$(PinnedDynamoStoreRootPackage)' != '' " Include="Propulsion.DynamoStore" Version="$(PinnedDynamoStoreRootPackage)" />
Expand Down
15 changes: 7 additions & 8 deletions src/Propulsion.DynamoStore.Notifier/Handler.fs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module Propulsion.DynamoStore.Notifier.Handler

open Amazon.DynamoDBv2
open Amazon.Lambda.DynamoDBEvents
open Amazon.DynamoDBStreams
open Amazon.SimpleNotificationService
open Amazon.SimpleNotificationService.Model
open Propulsion.DynamoStore
Expand All @@ -10,7 +9,7 @@ open System.Collections.Generic
open System.Net
open System.Threading

let private parse (log: Serilog.ILogger) (dynamoEvent: DynamoDBEvent): KeyValuePair<AppendsPartitionId, Propulsion.Feed.Position>[] =
let private parse (log: Serilog.ILogger) (dynamoEvent: Amazon.Lambda.DynamoDBEvents.DynamoDBEvent): KeyValuePair<AppendsPartitionId, Propulsion.Feed.Position>[] =
let tails = Dictionary()
let updateTails partitionId checkpoint =
match tails.TryGetValue partitionId with
Expand All @@ -20,16 +19,16 @@ let private parse (log: Serilog.ILogger) (dynamoEvent: DynamoDBEvent): KeyValueP
let mutable indexStream, otherStream, noEvents = 0, 0, 0
try for record in dynamoEvent.Records do
match record.Dynamodb.StreamViewType with
| x when x = StreamViewType.NEW_IMAGE || x = StreamViewType.NEW_AND_OLD_IMAGES -> ()
| x when x = string StreamViewType.NEW_IMAGE || x = string StreamViewType.NEW_AND_OLD_IMAGES -> ()
| x -> invalidOp $"Unexpected StreamViewType {x}"

if summary.Length <> 0 then summary.Append ' ' |> ignore
summary.Append(record.EventName.Value[0]) |> ignore
summary.Append(record.EventName) |> ignore

let updated = record.Dynamodb.NewImage
match record.EventName with
| ot when ot = OperationType.REMOVE -> ()
| ot when ot = OperationType.INSERT || ot = OperationType.MODIFY ->
| ot when ot = string OperationType.REMOVE -> ()
| ot when ot = string OperationType.INSERT || ot = string OperationType.MODIFY ->
let p = record.Dynamodb.Keys["p"].S
match FsCodec.StreamName.parse p with
| AppendsEpoch.Stream.For (partitionId, epochId) ->
Expand All @@ -50,7 +49,7 @@ let private parse (log: Serilog.ILogger) (dynamoEvent: DynamoDBEvent): KeyValueP
| _ ->
if p.StartsWith AppendsIndex.Stream.Category then indexStream <- indexStream + 1
else otherStream <- otherStream + 1
| et -> invalidOp $"Unknown OperationType %s{et.Value}"
| et -> invalidOp $"Unknown OperationType %s{et}"
log.Information("Index {indexCount} Other {otherCount} NoEvents {noEventCount} Tails {tails} {summary:l}",
indexStream, otherStream, noEvents, Seq.map ValueTuple.ofKvp tails, summary)
Array.ofSeq tails
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@
<ItemGroup>
<PackageReference Include="MinVer" Version="5.0.0" PrivateAssets="All" />

<PackageReference Include="Amazon.Lambda.Core" Version="2.1.0" />
<PackageReference Include="Amazon.Lambda.DynamoDBEvents" Version="2.1.1" />
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.3.0" />
<PackageReference Include="AWSSDK.SimpleNotificationService" Version="3.7.4.10" />
<PackageReference Include="Amazon.Lambda.Core" Version="2.8.1" />
<PackageReference Include="Amazon.Lambda.DynamoDBEvents" Version="3.1.2" />
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.5" />
<PackageReference Include="AWSSDK.DynamoDBStreams" Version="4.0.4.14" />
<PackageReference Include="AWSSDK.SimpleNotificationService" Version="4.0.2.16" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
<ProjectReference Condition=" '$(PinnedBaselineRootPackage)' == '' " Include="..\Propulsion\Propulsion.fsproj" />
<PackageReference Condition=" '$(PinnedBaselineRootPackage)' != '' " Include="Propulsion" Version="$(PinnedBaselineRootPackage)" />
Expand Down
2 changes: 1 addition & 1 deletion src/Propulsion.DynamoStore/Propulsion.DynamoStore.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<ItemGroup>
<PackageReference Include="MinVer" Version="5.0.0" PrivateAssets="All" />

<PackageReference Include="Equinox.DynamoStore" Version="4.0.0" />
<PackageReference Include="Equinox.DynamoStore" Version="4.2.0-rc.1" />
<PackageReference Include="FsCodec.SystemTextJson" Version="3.1.0" />
</ItemGroup>

Expand Down
6 changes: 3 additions & 3 deletions tools/Propulsion.Tool/Propulsion.Tool.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@

<PackageReference Include="Argu" Version="6.2.2" />
<!-- Required or there'll be an exception at runtime re missing support DLLs when using RBAC -->
<PackageReference Include="AWSSDK.SecurityToken" Version="3.7.1.177" />
<PackageReference Include="AWSSDK.SecurityToken" Version="4.0.5.9" />
<!-- Required for AWS SSO resolution -->
<PackageReference Include="AWSSDK.SSO" Version="3.7.100.69" />
<PackageReference Include="AWSSDK.SSOOIDC" Version="3.7.100.69" />
<PackageReference Include="AWSSDK.SSO" Version="4.0.2.13" />
<PackageReference Include="AWSSDK.SSOOIDC" Version="4.0.3.14" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
</ItemGroup>
Expand Down