Package io.microraft.exception
Class RaftException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- io.microraft.exception.RaftException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CannotReplicateException,IndeterminateStateException,LaggingCommitIndexException,MismatchingRaftGroupMembersCommitIndexException,NotLeaderException
public class RaftException extends RuntimeException
Base exception class for Raft-related exceptions.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RaftException(RaftEndpoint leader)Creates an instance of this exceptionRaftException(String message, RaftEndpoint leader)Creates an instance of this exceptionRaftException(String message, RaftEndpoint leader, Throwable cause)Creates an instance of this exceptionRaftException(Throwable cause)Creates an instance of this exception
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RaftEndpointgetLeader()Returns the leader endpoint of the related Raft group, if available and known by the Raft node by the time this exception is thrown.StringtoString()-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
-
-
-
Constructor Detail
-
RaftException
public RaftException(Throwable cause)
Creates an instance of this exception- Parameters:
cause- reason of this exception to be thrown
-
RaftException
public RaftException(RaftEndpoint leader)
Creates an instance of this exception- Parameters:
leader- Raft endpoint of the leader known by the local Raft node
-
RaftException
public RaftException(String message, RaftEndpoint leader)
Creates an instance of this exception- Parameters:
message- exception messageleader- Raft endpoint of the leader known by the local Raft node
-
RaftException
public RaftException(String message, RaftEndpoint leader, Throwable cause)
Creates an instance of this exception- Parameters:
message- exception messageleader- Raft endpoint of the leader known by the local Raft nodecause- reason of this exception to be thrown
-
-
Method Detail
-
getLeader
public RaftEndpoint getLeader()
Returns the leader endpoint of the related Raft group, if available and known by the Raft node by the time this exception is thrown.- Returns:
- the leader endpoint of the related Raft group, if available and known by the Raft node by the time this exception is thrown
-
-