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(PartitionId partitionId, RaftPartitionGroupConfig config, File dataDirectory) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFailureListener(FailureListener failureListener) voidaddRoleChangeListener(RaftRoleChangeListener listener) 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.voidremoveFailureListener(FailureListener failureListener) voidvoidsetMetadata(PartitionMetadata partitionMetadata) booleanstepDown()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
-
-
Method Details
-
addRoleChangeListener
-
removeRoleChangeListener
-
dataDirectory
Returns the partition data directory.- Returns:
- the partition data directory
-
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
-
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
-
getMetadata
-
setMetadata
-