public class SplitBrainProtectionConfig extends Object implements IdentifiedDataSerializable, NamedConfig
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:
To create a SplitBrainProtectionConfig
for probabilistic split brain protection, use
newProbabilisticSplitBrainProtectionConfigBuilder(String, int)
to configure and build the
SplitBrainProtectionConfig
.
To create a SplitBrainProtectionConfig
for recently-active split brain protection, use
newRecentlyActiveSplitBrainProtectionConfigBuilder(String, int, int)
to configure and build the
SplitBrainProtectionConfig
.
SplitBrainProtectionFunction
,
ProbabilisticSplitBrainProtectionFunction
,
RecentlyActiveSplitBrainProtectionFunction
Constructor and Description |
---|
SplitBrainProtectionConfig() |
SplitBrainProtectionConfig(SplitBrainProtectionConfig splitBrainProtectionConfig) |
SplitBrainProtectionConfig(String name) |
SplitBrainProtectionConfig(String name,
boolean enabled) |
SplitBrainProtectionConfig(String name,
boolean enabled,
int minimumClusterSize) |
public SplitBrainProtectionConfig()
public SplitBrainProtectionConfig(String name)
public SplitBrainProtectionConfig(String name, boolean enabled)
public SplitBrainProtectionConfig(String name, boolean enabled, int minimumClusterSize)
public SplitBrainProtectionConfig(SplitBrainProtectionConfig splitBrainProtectionConfig)
public String getName()
getName
in interface NamedConfig
public SplitBrainProtectionConfig setName(String name)
setName
in interface NamedConfig
public boolean isEnabled()
public SplitBrainProtectionConfig setEnabled(boolean enabled)
public int getMinimumClusterSize()
public SplitBrainProtectionConfig setMinimumClusterSize(int minimumClusterSize)
public SplitBrainProtectionOn getProtectOn()
public SplitBrainProtectionConfig setProtectOn(SplitBrainProtectionOn protectOn)
public List<SplitBrainProtectionListenerConfig> getListenerConfigs()
public SplitBrainProtectionConfig setListenerConfigs(List<SplitBrainProtectionListenerConfig> listenerConfigs)
public SplitBrainProtectionConfig addListenerConfig(SplitBrainProtectionListenerConfig listenerConfig)
public String getFunctionClassName()
public SplitBrainProtectionConfig setFunctionClassName(String functionClassName)
public SplitBrainProtectionFunction getFunctionImplementation()
public SplitBrainProtectionConfig setFunctionImplementation(SplitBrainProtectionFunction functionImplementation)
public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getClassId()
IdentifiedDataSerializable
getClassId
in interface IdentifiedDataSerializable
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- outputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
output stream has been closed.public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
input stream has been closed.public static ProbabilisticSplitBrainProtectionConfigBuilder newProbabilisticSplitBrainProtectionConfigBuilder(String name, int minimumClusterSize)
SplitBrainProtectionConfig
with the given name
using a probabilistic
split brain protection function, for the given split brain protection size
that is enabled by default.name
- the split brain protection's nameminimumClusterSize
- minimum count of members in the cluster not to be considered it split.ProbabilisticSplitBrainProtectionFunction
public static RecentlyActiveSplitBrainProtectionConfigBuilder newRecentlyActiveSplitBrainProtectionConfigBuilder(String name, int minimumClusterSize, int toleranceMillis)
SplitBrainProtectionConfig
with the given name
using a recently-active
split brain protection function for the given split brain protection size
that is enabled by default.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.RecentlyActiveSplitBrainProtectionFunction
Copyright © 2023 Hazelcast, Inc.. All rights reserved.