Table of Contents

Interface ICdcRepositoryLsnMapping

Namespace
Excalibur.Cdc.SqlServer
Assembly
Excalibur.Cdc.SqlServer.dll

Provides LSN-to-time mapping and advanced LSN navigation for SQL Server CDC.

public interface ICdcRepositoryLsnMapping

Remarks

This sub-interface separates LSN mapping concerns from the core CDC data retrieval in ICdcRepository. Consumers that only need to fetch changes can depend on the smaller ICdcRepository interface.

Methods

GetLsnToTimeAsync(byte[], CancellationToken)

Maps an LSN to a commit time in the database.

Task<DateTime?> GetLsnToTimeAsync(byte[] lsn, CancellationToken cancellationToken)

Parameters

lsn byte[]

The LSN to map to a time.

cancellationToken CancellationToken

A token to observe while waiting for the task to complete.

Returns

Task<DateTime?>

A task that represents the asynchronous operation, containing the mapped commit time as a nullable DateTime.

GetNextLsnAsync(string, byte[], CancellationToken)

Retrieves the next Log Sequence Number (LSN) after the specified last processed LSN for a specific capture instance.

Task<byte[]?> GetNextLsnAsync(string captureInstance, byte[] lastProcessedLsn, CancellationToken cancellationToken)

Parameters

captureInstance string

The name of the capture instance to query for the next LSN.

lastProcessedLsn byte[]

The LSN from which to find the next LSN.

cancellationToken CancellationToken

A token to observe while waiting for the task to complete.

Returns

Task<byte[]>

A task that represents the asynchronous operation, containing the next LSN as a nullable byte array, or null if no next LSN is available.

GetNextValidLsnAsync(byte[], CancellationToken)

Retrieves the next valid LSN after the specified last processed LSN.

Task<byte[]?> GetNextValidLsnAsync(byte[] lastProcessedLsn, CancellationToken cancellationToken)

Parameters

lastProcessedLsn byte[]

The LSN from which to find the next valid LSN.

cancellationToken CancellationToken

A token to observe while waiting for the task to complete.

Returns

Task<byte[]>

A task that represents the asynchronous operation, containing the next valid LSN as a nullable byte array.

GetTimeToLsnAsync(DateTime, string, CancellationToken)

Maps a time to an LSN using the specified relational operator.

Task<byte[]?> GetTimeToLsnAsync(DateTime lsnDate, string relationalOperator, CancellationToken cancellationToken)

Parameters

lsnDate DateTime

The date to map to an LSN.

relationalOperator string

The relational operator for mapping (e.g., "smallest greater than", "largest less than or equal").

cancellationToken CancellationToken

A token to observe while waiting for the task to complete.

Returns

Task<byte[]>

A task that represents the asynchronous operation, containing the mapped LSN as a nullable byte array.