PartitionWork

What a node runs for each partition of a context it holds: the context's timer runners, and the bringing-in-line of its jobs' instances. PartitionOwnership starts it once the partition's subscriptions and intake started, unless the partition's gate was lost meanwhile (to a fence, or to a renewal that did not get the lease back), and stops it first on a hand-off, before the lease is released, so it sends nothing as the owner of a partition the node handed off.

A loss does not stop it at once: the partition's gate takes no command from the loss on, and the reconcile the loss wakes stops the work with the rest of the partition (PartitionRuns.dropLost), or at once when the partition was still starting; a fence stops it within ClusterOptions.drainTimeout (GroupFence). Until then, what it sends goes where a command of a partition the node does not accept goes (PartitionedRouter): to the partition's next owner, which decides it as its own.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun startPartition(partition: Int)

Starts the work of partition, which the node has just acquired.

Link copied to clipboard
abstract suspend fun stop()

Stops the work of every partition.

Link copied to clipboard
abstract suspend fun stopPartition(partition: Int)

Stops the work of partition: the node hands it off, or lost it.