From 47b1857dfe05c7969ddaeb1b9fe5e68e2b0d36c3 Mon Sep 17 00:00:00 2001 From: vplauzon Date: Sat, 14 Sep 2024 18:11:07 -0400 Subject: [PATCH] . --- .../SourceTableExportingOrchestration.cs | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/code/KustoCopyConsole/Orchestration/SourceTableExportingOrchestration.cs b/code/KustoCopyConsole/Orchestration/SourceTableExportingOrchestration.cs index 8d18e2d..e170ebc 100755 --- a/code/KustoCopyConsole/Orchestration/SourceTableExportingOrchestration.cs +++ b/code/KustoCopyConsole/Orchestration/SourceTableExportingOrchestration.cs @@ -129,6 +129,18 @@ public IImmutableList GetOperationIds() } } + public RowItem RemoveBlockItem(string operationId) + { + lock (_operationIdToBlockMap) + { + var blockItem = _operationIdToBlockMap[operationId]; + + _operationIdToBlockMap.Remove(operationId); + + return blockItem; + } + } + public void AddOperationId(RowItem blockItem) { lock (_operationIdToBlockMap) @@ -460,7 +472,13 @@ private async Task OnExportedAsync(CancellationToken ct) switch (status.State) { case "Completed": - throw new NotSupportedException(); + var blockItem = clusterQueue.RemoveBlockItem(status.OperationId) + .Clone(); + + blockItem.State = SourceBlockState.Exported.ToString(); + await RowItemGateway.AppendAsync(blockItem, ct); + + break; case "Failed": throw new CopyException( $"Failed export '{status.OperationId}': '{status.Status}'",