public class PartitionGroupConfig extends Object
10.10.1.*
10.10.2.*
The interfaces can be configured with wildcards '*' and ranges e.g. '10-20'. Each member-group can have as many
interfaces as you want.
You can define as many groups as you want, Hazelcast will prevent that in a multi member cluster, backups are
going to be stored in the same group as the primary.
You need to be careful with selecting overlapping groups, e.g.
10.10.1.1
10.10.1.2
10.10.1.1
10.10.1.3
In this example there are 2 groups, but because interface 10.10.1.1 is shared between the 2 groups, there is still
a chance that this member is going to store primary and backups.
In the previous example we made use of custom group; we creates the groups manually and we configured the
interfaces for these groups. There also is another option that doesn't give you the same fine grained control,
but can prevent that on a single machine, running multiple HazelcastInstances, a primary and backup are going
to be stored. This can be done using the HOST_AWARE group-type:
Modifier and Type | Class and Description |
---|---|
static class |
PartitionGroupConfig.MemberGroupType |
Constructor and Description |
---|
PartitionGroupConfig() |
Modifier and Type | Method and Description |
---|---|
PartitionGroupConfig |
addMemberGroupConfig(MemberGroupConfig memberGroupConfig)
Adds a
MemberGroupConfig . |
PartitionGroupConfig |
clear()
Removes all the
PartitionGroupConfig.MemberGroupType instances. |
PartitionGroupConfig.MemberGroupType |
getGroupType()
Returns the MemberGroupType configured.
|
Collection<MemberGroupConfig> |
getMemberGroupConfigs()
Returns an unmodifiable collection containing all
MemberGroupConfig elements. |
boolean |
isEnabled()
Checks if this PartitionGroupConfig is enabled.
|
PartitionGroupConfig |
setEnabled(boolean enabled)
Enables or disables this PartitionGroupConfig.
|
PartitionGroupConfig |
setGroupType(PartitionGroupConfig.MemberGroupType memberGroupType)
Sets the MemberGroupType.
|
PartitionGroupConfig |
setMemberGroupConfigs(Collection<MemberGroupConfig> memberGroupConfigs)
Adds a MemberGroupConfig.
|
String |
toString() |
public boolean isEnabled()
public PartitionGroupConfig setEnabled(boolean enabled)
enabled
- true if enabled, false if disabled.public PartitionGroupConfig.MemberGroupType getGroupType()
public PartitionGroupConfig setGroupType(PartitionGroupConfig.MemberGroupType memberGroupType)
PartitionGroupConfig.MemberGroupType.HOST_AWARE
group type, Hazelcast makes a group for every host, that prevent
a single host is going to contain primary and backup. See the MemberGroupConfig
for more information.memberGroupType
- the MemberGroupType to set.IllegalArgumentException
- if memberGroupType is null.getGroupType()
public PartitionGroupConfig addMemberGroupConfig(MemberGroupConfig memberGroupConfig)
MemberGroupConfig
. Duplicate elements are not filtered.memberGroupConfig
- the MemberGroupConfig to add.IllegalArgumentException
- if memberGroupConfig is null.addMemberGroupConfig(MemberGroupConfig)
public Collection<MemberGroupConfig> getMemberGroupConfigs()
MemberGroupConfig
elements.setMemberGroupConfigs(java.util.Collection)
public PartitionGroupConfig clear()
PartitionGroupConfig.MemberGroupType
instances.setMemberGroupConfigs(java.util.Collection)
public PartitionGroupConfig setMemberGroupConfigs(Collection<MemberGroupConfig> memberGroupConfigs)
PartitionGroupConfig.MemberGroupType.CUSTOM
. See the PartitionGroupConfig
for more information and examples
of how this mechanism works.memberGroupConfigs
- the collection of MemberGroupConfig to add.IllegalArgumentException
- if memberGroupConfigs is null.getMemberGroupConfigs()
,
clear()
,
addMemberGroupConfig(MemberGroupConfig)
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.