seqeron 0.18.0
Loading...
Searching...
No Matches
Org.Limitless.Seqeron.Replayer.Client.ReplayerStreamReceiver Class Referencesealed

App-replica side of the per-node ReplayerService: reads the co-located queue live and asks the Replayer for history and gaps. The Aeron adapter only: every decision lives in ReplayerRecovery. ReplayerStreamReceiver.java and replayer/client/ReplayerStreamReceiver.hpp are its twins. More...

Inheritance diagram for Org.Limitless.Seqeron.Replayer.Client.ReplayerStreamReceiver:
Collaboration diagram for Org.Limitless.Seqeron.Replayer.Client.ReplayerStreamReceiver:

Public Member Functions

 ReplayerStreamReceiver (int clientId, SequencedHandler onSequenced, LeadershipHandler onLeadershipChanged, CaughtUpHandler onCaughtUp, Func< bool > queueFaults=null, Func< bool > controlFaults=null, Func< long, bool > replayFaults=null)
 A receiver, dropping a live queue frame whenever queueFaults answers true, a Replayer reply whenever controlFaults does, and a replay frame whenever replayFaults does.
 
void OnSnapshotRound (Action< long, long > handler)
 Hands each SnapshotRound the Replayer sends to handler , with the round and its cut; none is delivered without one (doc/snapshot.md §10.8).
 
bool SendSnapshotJoined (int sourceId, long round)
 Tells the Replayer this replica takes part in round . Best-effort: the offer may not land.
 
bool SendSnapshotConfirmed (int sourceId, long round)
 Tells the Replayer this replica's file for round is durable under its name. Best-effort: the offer may not land.
 
void RestoreFrom (SnapshotStore store, ISnapshotRestoreHandler handler)
 Restores the newest snapshot in store on Start, before anything is dispatched, once a replay shows the log holds its cut (doc/snapshot.md §7). Call before Start; RestoreFailure reports a snapshot that cannot be restored.
 
void Start (Aeron aeron, int memberId, int groupId)
 Subscribes the queue of a group and the control stream, opens the request publication and the convergence counter, and requests the cold-start replay from the recording's start, or the snapshot to restore first.
 
int Poll ()
 One duty-cycle iteration: drain control, ride an attached replay image, and always drain and dispatch the queue — ReplayerRecovery's contiguity check, not the poll routing, decides what a queue frame is worth mid-walk.
 
void Dispose ()
 Closes every subscription, the publication and the counter. The Aeron client is the caller's.
 

Static Public Attributes

const string QueueConsumerChannel = FrameLayer.QueueChannel + "|tether=false"
 The queue as a consumer addresses it: untethered, so a slow app is dropped and heals via replay.
 

Properties

bool IsCaughtUp [get]
 Whether this client is following the live tail; revoked on a queue gap or an eviction from the queue, re-established at the seam.
 
long LastClusterSeqNo [get]
 Highest clusterSeqNo dispatched in order, 0 before the first. The frontier a consumer measures its own recovery progress by.
 
int CurrentLeaderMemberId [get]
 memberId of the current leader per the last LeadershipChanged processed, or -1 until one is seen. A replica emits iff its own node is this leader.
 
string RestoreFailure [get]
 Why the snapshot given to RestoreFrom cannot be restored, or null. Latched: recovery has stopped.
 

Detailed Description

App-replica side of the per-node ReplayerService: reads the co-located queue live and asks the Replayer for history and gaps. The Aeron adapter only: every decision lives in ReplayerRecovery. ReplayerStreamReceiver.java and replayer/client/ReplayerStreamReceiver.hpp are its twins.

Single-threaded: every method runs on the one duty-cycle thread.

Constructor & Destructor Documentation

◆ ReplayerStreamReceiver()

Org.Limitless.Seqeron.Replayer.Client.ReplayerStreamReceiver.ReplayerStreamReceiver ( int  clientId,
SequencedHandler  onSequenced,
LeadershipHandler  onLeadershipChanged,
CaughtUpHandler  onCaughtUp,
Func< bool >  queueFaults = null,
Func< bool >  controlFaults = null,
Func< long, bool >  replayFaults = null 
)
inline

A receiver, dropping a live queue frame whenever queueFaults answers true, a Replayer reply whenever controlFaults does, and a replay frame whenever replayFaults does.

Parameters
clientIdthis replica's id on the node, its counters' client label; replicas sharing one share their counters' series
onSequencedreceives every in-order frame
onLeadershipChangedreceives each leadership change, or null to have it reach onSequenced
onCaughtUpfires on every transition to caught-up, or null
queueFaultstest harnesses only: polled once per live queue frame, on the poll thread; null drops nothing
controlFaultstest harnesses only: polled once per Replaying or ReplayPending, on the poll thread; null drops nothing. A SnapshotRound is not a reply and is never dropped.
replayFaultstest harnesses only: polled once per replay frame with where it starts in the recording, on the poll thread; null drops nothing
Exceptions
ArgumentNullExceptionif onSequenced is null

Member Function Documentation

◆ Dispose()

void Org.Limitless.Seqeron.Replayer.Client.ReplayerStreamReceiver.Dispose ( )
inline

Closes every subscription, the publication and the counter. The Aeron client is the caller's.

◆ OnSnapshotRound()

void Org.Limitless.Seqeron.Replayer.Client.ReplayerStreamReceiver.OnSnapshotRound ( Action< long, long >  handler)
inline

Hands each SnapshotRound the Replayer sends to handler , with the round and its cut; none is delivered without one (doc/snapshot.md §10.8).

Parameters
handlerreceives the round's number and its cut's clusterSeqNo

◆ Poll()

int Org.Limitless.Seqeron.Replayer.Client.ReplayerStreamReceiver.Poll ( )
inline

One duty-cycle iteration: drain control, ride an attached replay image, and always drain and dispatch the queue — ReplayerRecovery's contiguity check, not the poll routing, decides what a queue frame is worth mid-walk.

Returns
fragments consumed and snapshot records restored
Exceptions
InvalidOperationExceptiononce this node's recording does not hold what recovery asked of it

◆ RestoreFrom()

void Org.Limitless.Seqeron.Replayer.Client.ReplayerStreamReceiver.RestoreFrom ( SnapshotStore  store,
ISnapshotRestoreHandler  handler 
)
inline

Restores the newest snapshot in store on Start, before anything is dispatched, once a replay shows the log holds its cut (doc/snapshot.md §7). Call before Start; RestoreFailure reports a snapshot that cannot be restored.

Parameters
storethis instance's snapshot files
handlertakes the restored records

◆ SendSnapshotConfirmed()

bool Org.Limitless.Seqeron.Replayer.Client.ReplayerStreamReceiver.SendSnapshotConfirmed ( int  sourceId,
long  round 
)
inline

Tells the Replayer this replica's file for round is durable under its name. Best-effort: the offer may not land.

Parameters
sourceIdthe application's sourceId
roundthe round's number
Returns
whether it was placed

◆ SendSnapshotJoined()

bool Org.Limitless.Seqeron.Replayer.Client.ReplayerStreamReceiver.SendSnapshotJoined ( int  sourceId,
long  round 
)
inline

Tells the Replayer this replica takes part in round . Best-effort: the offer may not land.

Parameters
sourceIdthe application's sourceId
roundthe round's number
Returns
whether it was placed

◆ Start()

void Org.Limitless.Seqeron.Replayer.Client.ReplayerStreamReceiver.Start ( Aeron  aeron,
int  memberId,
int  groupId 
)
inline

Subscribes the queue of a group and the control stream, opens the request publication and the convergence counter, and requests the cold-start replay from the recording's start, or the snapshot to restore first.

Parameters
aeronclient sharing the co-located node's media driver
memberIdthis app's node, to label the counter
groupIdthe group whose queue to read: a consumer names its own, a façade passes the one the Replayer resolved (spec R-6)

Member Data Documentation

◆ QueueConsumerChannel

const string Org.Limitless.Seqeron.Replayer.Client.ReplayerStreamReceiver.QueueConsumerChannel = FrameLayer.QueueChannel + "|tether=false"
static

The queue as a consumer addresses it: untethered, so a slow app is dropped and heals via replay.

Property Documentation

◆ CurrentLeaderMemberId

int Org.Limitless.Seqeron.Replayer.Client.ReplayerStreamReceiver.CurrentLeaderMemberId
get

memberId of the current leader per the last LeadershipChanged processed, or -1 until one is seen. A replica emits iff its own node is this leader.

◆ IsCaughtUp

bool Org.Limitless.Seqeron.Replayer.Client.ReplayerStreamReceiver.IsCaughtUp
get

Whether this client is following the live tail; revoked on a queue gap or an eviction from the queue, re-established at the seam.

◆ LastClusterSeqNo

long Org.Limitless.Seqeron.Replayer.Client.ReplayerStreamReceiver.LastClusterSeqNo
get

Highest clusterSeqNo dispatched in order, 0 before the first. The frontier a consumer measures its own recovery progress by.

◆ RestoreFailure

string Org.Limitless.Seqeron.Replayer.Client.ReplayerStreamReceiver.RestoreFailure
get

Why the snapshot given to RestoreFrom cannot be restored, or null. Latched: recovery has stopped.


The documentation for this class was generated from the following file: