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
clientElasticsearchClientThe Elasticsearch client for storing error records.
optionsIOptions<ElasticsearchConfigurationOptions>The configuration options containing error handling settings.
loggerILogger<ProjectionErrorHandler>The logger for diagnostic information.
meterFactoryIMeterFactoryThe 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
fromDateDateTimeThe start date for retrieving error records.
toDateDateTimeThe end date for retrieving error records.
projectionTypestringOptional filter by projection type.
maxResultsintMaximum number of results to return.
cancellationTokenCancellationTokenThe 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
contextBulkOperationErrorContextThe bulk operation error context containing both successful and failed items.
cancellationTokenCancellationTokenThe 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
contextProjectionErrorContextThe context of the failed projection operation.
cancellationTokenCancellationTokenThe 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
errorIdsIEnumerable<string>The identifiers of the resolved errors.
cancellationTokenCancellationTokenThe cancellation token.