Interface ShardManagerInfoMBean
public interface ShardManagerInfoMBean
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumBehaviours we can switch to. -
Method Summary
Modifier and TypeMethodDescriptionReturns the list of all the local shard names.Returns the name of the local member.booleanReturns the overall sync status for all shards.voidswitchAllLocalShardsState(ShardManagerInfoMBean.TargetBehavior targetBehavior, long term) Switches the raft behavior of all the local shards to the newBehavior.voidswitchShardState(String shardName, ShardManagerInfoMBean.TargetBehavior targetBehavior, long term) Switches the raft behavior of the shard specified by shardName to the newBehavior.
-
Method Details
-
getLocalShards
Returns the list of all the local shard names.- Returns:
- a list of all the local shard names
-
getSyncStatus
boolean getSyncStatus()Returns the overall sync status for all shards.- Returns:
- true if all local shards are in sync with their corresponding leaders
-
getMemberName
String getMemberName()Returns the name of the local member.- Returns:
- the local member name
-
switchAllLocalShardsState
Switches the raft behavior of all the local shards to the newBehavior.- Parameters:
targetBehavior- aShardManagerInfoMBean.TargetBehaviorterm- when switching to the Leader specifies for which term the Shard would be the Leader. Any modifications made to state will be written with this term. This term will then be used by the Raft replication implementation to decide which modifications should stay and which ones should be removed. Ideally the term provided when switching to a new Leader should always be higher than the previous term.
-
switchShardState
void switchShardState(String shardName, ShardManagerInfoMBean.TargetBehavior targetBehavior, long term) Switches the raft behavior of the shard specified by shardName to the newBehavior.- Parameters:
shardName- a shard that is local to this shard managertargetBehavior- aShardManagerInfoMBean.TargetBehaviorterm- when switching to the Leader specifies for which term the Shard would be the Leader. Any modifications made to state will be written with this term. This term will then be used by the Raft replication implementation to decide which modifications should stay and which ones should be removed. Ideally the term provided when switching to a new Leader should always be higher than the previous term.
-