Class FencedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.krabka.streams.coordination.CoordinationException
io.krabka.streams.coordination.FencedException
- All Implemented Interfaces:
Serializable
Reports that the broker refused a write, because another member holds the role now.
This is the expected end of a leadership. The transport throws it for broker error
code 47 INVALID_PRODUCER_EPOCH and for broker error code 90
PRODUCER_FENCED. A deposed leader learns that it lost the role from this
exception, and from nothing else. No clock takes part in the check.
The epoch that the member held is superseded, so the cluster already rejects every write that the member makes. The caller stops the work of the role at once. A retry of the same write cannot succeed.
Example
try {
leadership.renew();
} catch (FencedException lost) {
controller.stop();
}
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFencedException(Role role, Throwable cause) Creates an exception for the role that this member no longer holds. -
Method Summary
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
FencedException
-
-
Method Details
-
role
-