Interface PartitionTransition
- All Known Implementing Classes:
PartitionTransitionImpl
public interface PartitionTransition
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classUsed to exceptionally complete transition futures when the transition was cancelled.static final classUsed to exceptionally complete transition futures when the prepare phase of the transition did not complete successfully. -
Method Summary
Modifier and TypeMethodDescriptionvoidsetConcurrencyControl(ConcurrencyControl concurrencyControl) Sets the ConcurrencyControl through which tasks are executed.toFollower(long currentTerm) Transitions to follower asynchronously by closing the current partition's components and opening a follower partition.toInactive(long term) Closes the current partition's components asynchronously.toLeader(long currentTerm) Transitions to leader asynchronously by closing the current partition's components and opening a leader partition.voidupdateTransitionContext(PartitionTransitionContext transitionContext) Sets the transition context
-
Method Details
-
toFollower
Transitions to follower asynchronously by closing the current partition's components and opening a follower partition.- Parameters:
currentTerm- the current term on which the transition happens- Returns:
- an ActorFuture to be completed when the transition is complete. Completed exceptionally
with
PartitionTransition.CancelledPartitionTransitionif the partition was cancelled.
-
toLeader
Transitions to leader asynchronously by closing the current partition's components and opening a leader partition.- Parameters:
currentTerm- the current term on which the transition happens- Returns:
- an ActorFuture to be completed when the transition is complete. Completed exceptionally
* with
PartitionTransition.CancelledPartitionTransitionif the partition was cancelled.
-
toInactive
Closes the current partition's components asynchronously.- Parameters:
term-- Returns:
- an ActorFuture completed when the transition is complete. Completed exceptionally *
with
PartitionTransition.CancelledPartitionTransitionif the partition was cancelled.
-
setConcurrencyControl
Sets the ConcurrencyControl through which tasks are executed.- Parameters:
concurrencyControl- the concurrency control
-
updateTransitionContext
Sets the transition context- Parameters:
transitionContext- the context to be used
-
getHealthIssue
HealthIssue getHealthIssue()- Returns:
- null if transition is healthy or a
HealthIssueif not.
-