Enum Class EmptyRaftManager
- All Implemented Interfaces:
Serializable,Comparable<EmptyRaftManager>,Constable,org.infinispan.commons.api.Lifecycle,RaftManager
A NO-OP implementation of
RaftManager.
This implementation is used when RAFT is not supported by the Transport.
- Since:
- 14.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescription<T extends RaftStateMachine>
TgetOrRegisterStateMachine(String channelName, Supplier<T> supplier, RaftChannelConfiguration configuration) Register aRaftStateMachine.booleanCheck if a RAFT leader is elected for theRaftStateMachinewith namechannelName.booleanraftId()voidstart()voidstop()static EmptyRaftManagerReturns the enum constant of this class with the specified name.static EmptyRaftManager[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getOrRegisterStateMachine
public <T extends RaftStateMachine> T getOrRegisterStateMachine(String channelName, Supplier<T> supplier, RaftChannelConfiguration configuration) Description copied from interface:RaftManagerRegister aRaftStateMachine.If the RAFT protocol is not supported, this method return
null. If aRaftStateMachinealready exists with namechannelName, the existing instance is returned.If
RaftManager.isRaftAvailable()returnfalse, this method always returnsnull.- Specified by:
getOrRegisterStateMachinein interfaceRaftManager- Type Parameters:
T- The concreteRaftStateMachineimplementation.- Parameters:
channelName- The name identifying theRaftStateMachine.supplier- The factory to create a new instance ofRaftStateMachine.configuration- TheRaftChannelConfigurationfor theRaftChannel.- Returns:
- The
RaftStateMachineinstance ofnullif unable to create or configure theRaftChannel.
-
isRaftAvailable
public boolean isRaftAvailable()- Specified by:
isRaftAvailablein interfaceRaftManager- Returns:
trueif the RAFT protocol is available to be used,falseotherwise.
-
hasLeader
Description copied from interface:RaftManagerCheck if a RAFT leader is elected for theRaftStateMachinewith namechannelName.- Specified by:
hasLeaderin interfaceRaftManager- Parameters:
channelName- The name identifying theRaftStateMachine.- Returns:
trueif the leader exists,falseotherwise.
-
raftId
- Specified by:
raftIdin interfaceRaftManager- Returns:
- This node raft-id.
-
start
public void start()- Specified by:
startin interfaceorg.infinispan.commons.api.Lifecycle
-
stop
public void stop()- Specified by:
stopin interfaceorg.infinispan.commons.api.Lifecycle
-