Table of Contents

Class ProjectionErrorHandler

Namespace
Excalibur.Data.ElasticSearch.Projections
Assembly
Excalibur.Data.ElasticSearch.dll

Implements error handling for projection operations in ElasticSearch.

public sealed class ProjectionErrorHandler : IProjectionErrorHandler
Inheritance
ProjectionErrorHandler
Implements
Inherited Members

Constructors

ProjectionErrorHandler(ElasticsearchClient, IOptions<ElasticsearchConfigurationOptions>, ILogger<ProjectionErrorHandler>, IMeterFactory)

Initializes a new instance of the ProjectionErrorHandler class.

public ProjectionErrorHandler(ElasticsearchClient client, IOptions<ElasticsearchConfigurationOptions> options, ILogger<ProjectionErrorHandler> logger, IMeterFactory meterFactory)

Parameters

client ElasticsearchClient

The Elasticsearch client for storing error records.

options IOptions<ElasticsearchConfigurationOptions>

The configuration options containing error handling settings.

logger ILogger<ProjectionErrorHandler>

The logger for diagnostic information.

meterFactory IMeterFactory

The meter factory for creating metrics instruments.

Exceptions

ArgumentNullException

Thrown when any required parameter is null.

Methods

GetProjectionErrorsAsync(DateTime, DateTime, string?, int, CancellationToken)

Retrieves projection errors for analysis and potential reprocessing.

public Task<IEnumerable<ProjectionErrorRecord>> GetProjectionErrorsAsync(DateTime fromDate, DateTime toDate, string? projectionType, int maxResults, CancellationToken cancellationToken)

Parameters

fromDate DateTime

The start date for retrieving error records.

toDate DateTime

The end date for retrieving error records.

projectionType string

Optional filter by projection type.

maxResults int

Maximum number of results to return.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IEnumerable<ProjectionErrorRecord>>

A collection of projection error records matching the criteria.

HandleBulkOperationErrorsAsync(BulkOperationErrorContext, CancellationToken)

Handles errors from bulk operations where some documents may have succeeded.

public Task HandleBulkOperationErrorsAsync(BulkOperationErrorContext context, CancellationToken cancellationToken)

Parameters

context BulkOperationErrorContext

The bulk operation error context containing both successful and failed items.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

A task representing the asynchronous bulk error handling operation.

HandleProjectionErrorAsync(ProjectionErrorContext, CancellationToken)

Handles an error that occurred during a projection operation.

public Task HandleProjectionErrorAsync(ProjectionErrorContext context, CancellationToken cancellationToken)

Parameters

context ProjectionErrorContext

The context of the failed projection operation.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

A task representing the asynchronous error handling operation.

MarkErrorsAsResolvedAsync(IEnumerable<string>, CancellationToken)

Marks projection errors as resolved after successful reprocessing.

public Task<int> MarkErrorsAsResolvedAsync(IEnumerable<string> errorIds, CancellationToken cancellationToken)

Parameters

errorIds IEnumerable<string>

The identifiers of the resolved errors.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<int>

The number of errors marked as resolved.