Table of Contents

Class MinHeapComparer

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

Compares tuples of LSN and table name for sorting in a min-heap. Orders by ascending LSN; if equal, orders lexically by table name.

public sealed class MinHeapComparer : IComparer<(byte[] Lsn, string TableName)>, IComparer
Inheritance
MinHeapComparer
Implements
Inherited Members

Methods

Compare(object?, object?)

Compares two objects as LSN/table-name tuples for min-heap ordering.

public int Compare(object? x, object? y)

Parameters

x object

The first object to compare. Must be a ValueTuple<byte[], string>.

y object

The second object to compare. Must be a ValueTuple<byte[], string>.

Returns

int

A negative value if x is less than y, zero if they are equal, or a positive value if x is greater than y.

Exceptions

ArgumentException

Thrown when either argument is not a ValueTuple<byte[], string>.

Compare((byte[] Lsn, string TableName), (byte[] Lsn, string TableName))

Compares two tuples containing LSN and table name pairs for ordering in a min-heap structure.

public int Compare((byte[] Lsn, string TableName) x, (byte[] Lsn, string TableName) y)

Parameters

x (byte[] Lsn, string TableName)

The first tuple to compare, containing an LSN byte array and table name.

y (byte[] Lsn, string TableName)

The second tuple to compare, containing an LSN byte array and table name.

Returns

int

A signed integer that indicates the relative values of x and y: Less than zero if x is less than y (x should come before y in sort order); Zero if x equals y; Greater than zero if x is greater than y (x should come after y in sort order). Comparison is performed first by LSN in ascending order, then by table name lexically if LSNs are equal.