Class LeaderChangedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.loomcache.common.exception.LoomException
com.loomcache.common.exception.LeaderChangedException
- All Implemented Interfaces:
Serializable
Thrown when a write request's pending status becomes uncertain due to leadership change.
This exception is raised when a node steps down from leader during the commit phase. The entry may or may not be committed on the new leader, implementing at-least-once semantics. Clients should retry the request on a new leader.
Semantics: - The entry was accepted by THIS leader and added to the log - The entry may be committed on a new leader - The write should be retried on the new leader
This is different from NotLeaderException, which means this node is not the leader, so the client should retry elsewhere.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLeaderChangedException(@Nullable String newLeaderId) Creates a new LeaderChangedException. -
Method Summary
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
LeaderChangedException
Creates a new LeaderChangedException.- Parameters:
newLeaderId- the ID of the new leader (may be null if unknown)
-