Package io.atomix.raft.partition
Class RaftPartition
java.lang.Object
io.atomix.raft.partition.RaftPartition
- All Implemented Interfaces:
Partition,HealthMonitorable
Abstract partition.
-
Constructor Summary
ConstructorsConstructorDescriptionRaftPartition(PartitionMetadata partitionMetadata, RaftPartitionConfig config, File dataDirectory) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFailureListener(FailureListener failureListener) voidaddRoleChangeListener(RaftRoleChangeListener listener) close()Closes the partition.protected RaftPartitionServercreateServer(PartitionManagementService managementService) Creates a Raft server.Returns the partition data directory.delete()Deletes the partition.getName()getRole()id()Returns the partition identifier.members()Returns the collection of all members in the partition.name()Returns the partition name.open(PartitionManagementService managementService) Opens the partition.voidremoveFailureListener(FailureListener failureListener) voidbooleanstepDown()Tries to step down if the following conditions are met: priority election is enabled the partition distributor determined a primary node this node is not the primarystop()longterm()Returns the partition term.toString()
-
Constructor Details
-
RaftPartition
public RaftPartition(PartitionMetadata partitionMetadata, RaftPartitionConfig config, File dataDirectory)
-
-
Method Details
-
addRoleChangeListener
-
removeRoleChangeListener
-
dataDirectory
Returns the partition data directory.- Returns:
- the partition data directory
-
open
Opens the partition. -
createServer
Creates a Raft server. -
name
Returns the partition name.- Returns:
- the partition name
-
getName
- Specified by:
getNamein interfaceHealthMonitorable
-
getHealthReport
- Specified by:
getHealthReportin interfaceHealthMonitorable
-
addFailureListener
- Specified by:
addFailureListenerin interfaceHealthMonitorable
-
removeFailureListener
- Specified by:
removeFailureListenerin interfaceHealthMonitorable
-
close
Closes the partition. -
delete
Deletes the partition.- Returns:
- future to be completed once the partition has been deleted
-
toString
-
id
Description copied from interface:PartitionReturns the partition identifier. -
term
public long term()Description copied from interface:PartitionReturns the partition term. -
members
Description copied from interface:PartitionReturns the collection of all members in the partition. -
getRole
-
getServer
-
stepDown
-
stepDownIfNotPrimary
Tries to step down if the following conditions are met:- priority election is enabled
- the partition distributor determined a primary node
- this node is not the primary
-
shouldStepDown
-
stop
-
getPartitionConfig
-