Class RedbAssignmentManager

Assembly: redb.Tsak.Core.Pro.dll

Module assignment manager on redb storage ().
Leader creates/updates assignments; each node reads its own assignments.
The cluster invariant "a module runs on exactly one node" is enforced by the database:
one record per (cluster, group, module) under the unique key
ValueUnique = "{cluster}:{group}:{module}", and writes are epoch-fenced — a stale leader
(lower epoch) cannot clobber the current leader's assignment. Every read is scoped to this
node's cluster and group, so an equally named group of another cluster on the same database
never sees these assignments.

public sealed class RedbAssignmentManager : IAssignmentManager

Inheritance

Object→RedbAssignmentManager

Implements

Methods

GetAllAssignmentsAsync(CancellationToken)

Returns all assignments in the cluster.

public Task<IReadOnlyList<RedbObject<TsakAssignmentProps>>> GetAllAssignmentsAsync(CancellationToken ct = default)

GetAssignmentsForNodeAsync(string, CancellationToken)

Returns assignments for a specific node.

public Task<IReadOnlyList<RedbObject<TsakAssignmentProps>>> GetAssignmentsForNodeAsync(string nodeId, CancellationToken ct = default)

RemoveAssignmentAsync(string, CancellationToken)

Removes a specific module assignment.

public Task RemoveAssignmentAsync(string moduleName, CancellationToken ct = default)

RemoveAssignmentsForNodeAsync(string, CancellationToken)

Removes all assignments for a given node (e.g. dead node cleanup).

public Task RemoveAssignmentsForNodeAsync(string nodeId, CancellationToken ct = default)

SaveAssignmentsAsync(IEnumerable<RedbObject<TsakAssignmentProps>>, CancellationToken)

Saves (creates or updates) a batch of assignments. Leader only.

public Task SaveAssignmentsAsync(IEnumerable<RedbObject<TsakAssignmentProps>> assignments, CancellationToken ct = default)

Constructors