Skip to main content

ImportOutputManager

  • Namespace: PPDS.Migration.Progress
  • Assembly: PPDS.Migration
  • Kind: Class
  • Implements: IAsyncDisposable, IDisposable

Summary

Manages streaming output for import operations.

Members

Constructors

ImportOutputManager(string basePath)

ImportOutputManager(string basePath)

Creates a new output manager for the specified base path.

  • Param basePath: Base path for output files. Files will be created as: {basePath}.errors.jsonl, {basePath}.progress.log, {basePath}.summary.json

Methods

Dispose

void Dispose()

(inherited from System.IDisposable.Dispose)

DisposeAsync

ValueTask DisposeAsync()

(inherited from System.IAsyncDisposable.DisposeAsync)

LogEntityError

void LogEntityError(string entityLogicalName, int failedRecords, string errorSummary)

Logs an entity-level error summary. Thread-safe.

  • Param entityLogicalName: Entity logical name.

  • Param failedRecords: Number of failed records.

  • Param errorSummary: Brief error description.

LogEntityProgress

void LogEntityProgress(string entityLogicalName, int processed, int total, double recordsPerSecond)

Logs entity progress with rate information. Thread-safe.

  • Param entityLogicalName: Entity logical name.

  • Param processed: Records processed.

  • Param total: Total records.

  • Param recordsPerSecond: Current throughput.

LogError

void LogError(MigrationError error)

Logs an error immediately to the errors file. Thread-safe.

  • Param error: The error to log.

LogProgress

void LogProgress(string message)

Logs a progress message immediately to the progress log. Thread-safe.

  • Param message: The progress message.

LogTierStart

void LogTierStart(int tierNumber, string[] entityNames)

Logs the start of a tier. Thread-safe.

  • Param tierNumber: Tier number.

  • Param entityNames: Entities in this tier.

WriteSummaryAsync

Task WriteSummaryAsync(ImportResult result, string sourceFile, string targetEnvironment, ImportExecutionContext executionContext, CancellationToken cancellationToken)

Writes the final summary to the summary file. Should be called on import completion (success, failure, or cancellation).

  • Param result: The import result.

  • Param sourceFile: Source data file path.

  • Param targetEnvironment: Target environment URL.

  • Param executionContext: Optional execution context.

  • Param cancellationToken: Cancellation token.

Properties

ErrorCount

int ErrorCount { get; }

Gets the number of errors logged so far.

ErrorsPath

string ErrorsPath { get; }

Gets the path to the errors file (.errors.jsonl).

ProgressPath

string ProgressPath { get; }

Gets the path to the progress log file (.progress.log).

SummaryPath

string SummaryPath { get; }

Gets the path to the summary file (.summary.json).