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) bootstrap(PartitionManagementService managementService, ReceivableSnapshotStore snapshotStore) Bootstraps a partition.close()Closes the partition.Returns the partition data directory.delete()Deletes the partition.getRole()id()Returns the partition identifier.join(PartitionManagementService managementService, ReceivableSnapshotStore snapshotStore) leave()members()Returns the collection of all members in the partition.name()Returns the partition name.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
-
bootstrap
public CompletableFuture<RaftPartition> bootstrap(PartitionManagementService managementService, ReceivableSnapshotStore snapshotStore) Bootstraps a partition. -
join
public CompletableFuture<RaftPartition> join(PartitionManagementService managementService, ReceivableSnapshotStore snapshotStore) -
leave
-
name
Returns the partition name.- Returns:
- the partition name
-
componentName
- Specified by:
componentNamein 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
-