Table of Contents

Interface IProjectionRebuildManager

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

Manages the rebuilding of projections from event stores or source data.

public interface IProjectionRebuildManager

Methods

CancelRebuildAsync(string, CancellationToken)

Cancels an ongoing rebuild operation.

Task<bool> CancelRebuildAsync(string operationId, CancellationToken cancellationToken)

Parameters

operationId string

The identifier of the rebuild operation to cancel.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<bool>

True if the operation was successfully cancelled; otherwise, false.

GetRebuildStatusAsync(string, CancellationToken)

Gets the current status of a rebuild operation.

Task<ProjectionRebuildStatus> GetRebuildStatusAsync(string operationId, CancellationToken cancellationToken)

Parameters

operationId string

The identifier of the rebuild operation.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<ProjectionRebuildStatus>

The current status of the rebuild operation.

ListRebuildOperationsAsync(DateTime, DateTime, string?, CancellationToken)

Lists all rebuild operations within a specified time range.

Task<IEnumerable<ProjectionRebuildSummary>> ListRebuildOperationsAsync(DateTime fromDate, DateTime toDate, string? projectionType, CancellationToken cancellationToken)

Parameters

fromDate DateTime

The start date for the query.

toDate DateTime

The end date for the query.

projectionType string

Optional exact filter by fully qualified projection type name (for example, typeof(OrderProjection).FullName).

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IEnumerable<ProjectionRebuildSummary>>

A collection of rebuild operation summaries.

StartRebuildAsync(ProjectionRebuildRequest, CancellationToken)

Initiates a full rebuild of a projection from the event store.

Task<ProjectionRebuildResult> StartRebuildAsync(ProjectionRebuildRequest request, CancellationToken cancellationToken)

Parameters

request ProjectionRebuildRequest

The rebuild request containing projection details and options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<ProjectionRebuildResult>

A rebuild operation result containing the operation identifier and status.

ValidateRebuildAsync(Type, CancellationToken)

Validates that a projection can be rebuilt, and reports what a rebuild would find.

Task<ProjectionRebuildValidation> ValidateRebuildAsync(Type projectionType, CancellationToken cancellationToken)

Parameters

projectionType Type

The projection type to validate.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<ProjectionRebuildValidation>

A validation result indicating whether the rebuild is possible.

Remarks

Takes the TYPE rather than its name because a projection's declared generation lives on the type. A caller holding only a name cannot resolve one, so validation would report on the first generation's index while the store writes to the generation the type declares -- a confident answer about an index the rebuild is not targeting.