Interface SplitBrainProtectionService
public interface SplitBrainProtectionService
Split brain protection service can be used to trigger cluster split brain protections at any time.
Normally split brain protections are done when any change happens on the member list.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
ensureNoSplitBrain
(String splitBrainProtectionName, SplitBrainProtectionOn requiredSplitBrainProtectionPermissionType) Ensures that the split brain protection with the given name is present.getSplitBrainProtection
(String splitBrainProtectionName) Returns theSplitBrainProtection
instance for a given split brain protection name.
-
Method Details
-
getSplitBrainProtection
@Nonnull SplitBrainProtection getSplitBrainProtection(@Nonnull String splitBrainProtectionName) throws IllegalArgumentException Returns theSplitBrainProtection
instance for a given split brain protection name.- Parameters:
splitBrainProtectionName
- name of the split brain protection- Returns:
SplitBrainProtection
- Throws:
IllegalArgumentException
- if no split brain protection found for given nameNullPointerException
- if splitBrainProtectionName is null
-
ensureNoSplitBrain
void ensureNoSplitBrain(@Nullable String splitBrainProtectionName, @Nonnull SplitBrainProtectionOn requiredSplitBrainProtectionPermissionType) throws SplitBrainProtectionException Ensures that the split brain protection with the given name is present. Throws a SplitBrainProtectionException if split brain protection not present. Does not throw exception if splitBrainProtectionName null or split brain protection undefined. If (requiredSplitBrainProtectionPermissionType == READ) -> will check for presence of READ or READ_WRITE split brain protection
If (requiredSplitBrainProtectionPermissionType == WRITE) -> will check for presence of WRITE or READ_WRITE split brain protection
If (requiredSplitBrainProtectionPermissionType == READ_WRITE) -> will check for presence of READ_WRITE split brain protection- Parameters:
splitBrainProtectionName
- split brain protection name to ensure, can be null or emptyrequiredSplitBrainProtectionPermissionType
- type of split brain protection required- Throws:
SplitBrainProtectionException
- if split brain protection defined and not present
-