Class SplitBrainProtectionConfig
- All Implemented Interfaces:
NamedConfig
,DataSerializable
,IdentifiedDataSerializable
Since Hazelcast 3.5, the default built-in split brain protection implementation keeps track of the number of members in the cluster, as determined by Hazelcast's cluster membership management.
Since Hazelcast 3.10, two additional built-in split brain protection implementations, decoupled from the existing cluster membership management, are provided:
- Probabilistic split brain protection: in this mode, member heartbeats are tracked and an adaptive failure
detector determines for each member the suspicion level. Additionally, when the Hazelcast member
is configured with the ICMP ping failure detector enabled and operating in parallel mode,
ping information is also used to detect member failures early.
To create a
SplitBrainProtectionConfig
for probabilistic split brain protection, usenewProbabilisticSplitBrainProtectionConfigBuilder(String, int)
to configure and build theSplitBrainProtectionConfig
. - Recently-active split brain protection: in this mode, for a member to be considered present for split brain
protection, a heartbeat must be received within the configured time-window since now. Additionally, when the
Hazelcast member is configured with the ICMP ping failure detector enabled and operating in
parallel mode, ping information is also used to detect member failures early.
To create a
SplitBrainProtectionConfig
for recently-active split brain protection, usenewRecentlyActiveSplitBrainProtectionConfigBuilder(String, int, int)
to configure and build theSplitBrainProtectionConfig
.
- See Also:
-
SplitBrainProtectionFunction
ProbabilisticSplitBrainProtectionFunction
RecentlyActiveSplitBrainProtectionFunction
-
Constructor Summary
ConstructorDescriptionSplitBrainProtectionConfig
(SplitBrainProtectionConfig splitBrainProtectionConfig) SplitBrainProtectionConfig
(String name, boolean enabled) SplitBrainProtectionConfig
(String name, boolean enabled, int minimumClusterSize) -
Method Summary
Modifier and TypeMethodDescriptionaddListenerConfig
(SplitBrainProtectionListenerConfig listenerConfig) boolean
int
Returns type identifier for this class.int
Returns DataSerializableFactory factory ID for this class.int
getName()
int
hashCode()
boolean
newProbabilisticSplitBrainProtectionConfigBuilder
(String name, int minimumClusterSize) Returns a builder forSplitBrainProtectionConfig
with the givenname
using a probabilistic split brain protection function, for the given split brain protectionsize
that is enabled by default.newRecentlyActiveSplitBrainProtectionConfigBuilder
(String name, int minimumClusterSize, int toleranceMillis) Returns a builder for aSplitBrainProtectionConfig
with the givenname
using a recently-active split brain protection function for the given split brain protectionsize
that is enabled by default.void
Reads fields from the input streamsetEnabled
(boolean enabled) setFunctionClassName
(String functionClassName) setFunctionImplementation
(SplitBrainProtectionFunction functionImplementation) setListenerConfigs
(List<SplitBrainProtectionListenerConfig> listenerConfigs) setMinimumClusterSize
(int minimumClusterSize) setProtectOn
(SplitBrainProtectionOn protectOn) toString()
void
Writes object fields to output stream
-
Constructor Details
-
SplitBrainProtectionConfig
public SplitBrainProtectionConfig() -
SplitBrainProtectionConfig
-
SplitBrainProtectionConfig
-
SplitBrainProtectionConfig
-
SplitBrainProtectionConfig
-
-
Method Details
-
getName
- Specified by:
getName
in interfaceNamedConfig
-
setName
- Specified by:
setName
in interfaceNamedConfig
-
isEnabled
public boolean isEnabled() -
setEnabled
-
getMinimumClusterSize
public int getMinimumClusterSize() -
setMinimumClusterSize
-
getProtectOn
-
setProtectOn
-
getListenerConfigs
-
setListenerConfigs
public SplitBrainProtectionConfig setListenerConfigs(List<SplitBrainProtectionListenerConfig> listenerConfigs) -
addListenerConfig
public SplitBrainProtectionConfig addListenerConfig(SplitBrainProtectionListenerConfig listenerConfig) -
getFunctionClassName
-
setFunctionClassName
-
getFunctionImplementation
-
setFunctionImplementation
public SplitBrainProtectionConfig setFunctionImplementation(SplitBrainProtectionFunction functionImplementation) -
toString
-
getFactoryId
public int getFactoryId()Description copied from interface:IdentifiedDataSerializable
Returns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryId
in interfaceIdentifiedDataSerializable
- Returns:
- factory ID
-
getClassId
public int getClassId()Description copied from interface:IdentifiedDataSerializable
Returns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
getClassId
in interfaceIdentifiedDataSerializable
- Returns:
- type ID
-
writeData
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Parameters:
out
- output- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Parameters:
in
- input- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
newProbabilisticSplitBrainProtectionConfigBuilder
public static ProbabilisticSplitBrainProtectionConfigBuilder newProbabilisticSplitBrainProtectionConfigBuilder(String name, int minimumClusterSize) Returns a builder forSplitBrainProtectionConfig
with the givenname
using a probabilistic split brain protection function, for the given split brain protectionsize
that is enabled by default.- Parameters:
name
- the split brain protection's nameminimumClusterSize
- minimum count of members in the cluster not to be considered it split.- See Also:
-
ProbabilisticSplitBrainProtectionFunction
-
newRecentlyActiveSplitBrainProtectionConfigBuilder
public static RecentlyActiveSplitBrainProtectionConfigBuilder newRecentlyActiveSplitBrainProtectionConfigBuilder(String name, int minimumClusterSize, int toleranceMillis) Returns a builder for aSplitBrainProtectionConfig
with the givenname
using a recently-active split brain protection function for the given split brain protectionsize
that is enabled by default.- Parameters:
name
- the split brain protection's nameminimumClusterSize
- minimum count of members in the cluster not to be considered it split.toleranceMillis
- maximum amount of milliseconds that may have passed since last heartbeat was received for a member to be considered present for split brain protection.- See Also:
-
RecentlyActiveSplitBrainProtectionFunction
-
equals
-
hashCode
public int hashCode()
-