joinConfig.getTcpIpConfig().setMembers(requireNonNull(members, "Members are missing")); config.getPartitionGroupConfig().setEnabled(false);
@Override public PartitionGroupConfig getPartitionGroupConfig() { return staticConfig.getPartitionGroupConfig(); }
@Override public PartitionGroupConfig getPartitionGroupConfig() { return staticConfig.getPartitionGroupConfig(); }
private void handlePartitionGroup(Node node) { NamedNodeMap attributes = node.getAttributes(); Node enabledNode = attributes.getNamedItem("enabled"); boolean enabled = enabledNode != null && getBooleanValue(getTextContent(enabledNode)); config.getPartitionGroupConfig().setEnabled(enabled); Node groupTypeNode = attributes.getNamedItem("group-type"); PartitionGroupConfig.MemberGroupType groupType = groupTypeNode != null ? PartitionGroupConfig.MemberGroupType.valueOf(upperCaseInternal(getTextContent(groupTypeNode))) : PartitionGroupConfig.MemberGroupType.PER_MEMBER; config.getPartitionGroupConfig().setGroupType(groupType); for (Node child : childElements(node)) { if ("member-group".equals(cleanNodeName(child))) { handleMemberGroup(child); } } }
private static Config finalizeConfig(final Config config, final BaseHazelcastProperties hz) { if (StringUtils.hasText(hz.getCluster().getPartitionMemberGroupType())) { val partitionGroupConfig = config.getPartitionGroupConfig(); val type = PartitionGroupConfig.MemberGroupType.valueOf( hz.getCluster().getPartitionMemberGroupType().toUpperCase()); LOGGER.debug("Using partition member group type [{}]", type); partitionGroupConfig.setEnabled(true).setGroupType(type); } return config; }
private void handlePartitionGroup(Node node) { NamedNodeMap attributes = node.getAttributes(); Node enabledNode = attributes.getNamedItem("enabled"); boolean enabled = enabledNode != null && getBooleanValue(getTextContent(enabledNode)); config.getPartitionGroupConfig().setEnabled(enabled); Node groupTypeNode = attributes.getNamedItem("group-type"); MemberGroupType groupType = groupTypeNode != null ? MemberGroupType.valueOf(upperCaseInternal(getTextContent(groupTypeNode))) : MemberGroupType.PER_MEMBER; config.getPartitionGroupConfig().setGroupType(groupType); for (Node child : childElements(node)) { if ("member-group".equals(cleanNodeName(child))) { handleMemberGroup(child); } } }
private void handleMemberGroup(Node node) { MemberGroupConfig memberGroupConfig = new MemberGroupConfig(); for (Node child : childElements(node)) { if ("interface".equals(cleanNodeName(child))) { String value = getTextContent(child); memberGroupConfig.addInterface(value); } } config.getPartitionGroupConfig().addMemberGroupConfig(memberGroupConfig); }
private void handleMemberGroup(Node node) { MemberGroupConfig memberGroupConfig = new MemberGroupConfig(); for (Node child : childElements(node)) { if ("interface".equals(cleanNodeName(child))) { String value = getTextContent(child); memberGroupConfig.addInterface(value); } } config.getPartitionGroupConfig().addMemberGroupConfig(memberGroupConfig); }
public PartitionStateManager(Node node, InternalPartitionServiceImpl partitionService, PartitionListener listener) { this.node = node; this.logger = node.getLogger(getClass()); this.partitionService = partitionService; partitionCount = partitionService.getPartitionCount(); this.partitions = new InternalPartitionImpl[partitionCount]; Address thisAddress = node.getThisAddress(); for (int i = 0; i < partitionCount; i++) { this.partitions[i] = new InternalPartitionImpl(i, listener, thisAddress); } memberGroupFactory = MemberGroupFactoryFactory.newMemberGroupFactory(node.getConfig().getPartitionGroupConfig(), node.getDiscoveryService()); partitionStateGenerator = new PartitionStateGeneratorImpl(); }
public PartitionStateManager(Node node, InternalPartitionServiceImpl partitionService, PartitionListener listener) { this.node = node; this.logger = node.getLogger(getClass()); this.partitionService = partitionService; this.partitionCount = partitionService.getPartitionCount(); this.partitions = new InternalPartitionImpl[partitionCount]; PartitionReplica localReplica = PartitionReplica.from(node.getLocalMember()); for (int i = 0; i < partitionCount; i++) { this.partitions[i] = new InternalPartitionImpl(i, listener, localReplica); } memberGroupFactory = MemberGroupFactoryFactory.newMemberGroupFactory(node.getConfig().getPartitionGroupConfig(), node.getDiscoveryService()); partitionStateGenerator = new PartitionStateGeneratorImpl(); }
public ConfigCheck(Config config, String joinerType) { this.joinerType = joinerType; // Copying all properties relevant for checking properties.put(PARTITION_COUNT.getName(), config.getProperty(PARTITION_COUNT.getName())); properties.put(APPLICATION_VALIDATION_TOKEN.getName(), config.getProperty(APPLICATION_VALIDATION_TOKEN.getName())); // Copying group-config settings GroupConfig groupConfig = config.getGroupConfig(); if (groupConfig != null) { this.groupName = groupConfig.getName(); } // Partition-group settings final PartitionGroupConfig partitionGroupConfig = config.getPartitionGroupConfig(); if (partitionGroupConfig != null) { partitionGroupEnabled = partitionGroupConfig.isEnabled(); if (partitionGroupEnabled) { memberGroupType = partitionGroupConfig.getGroupType(); } else { memberGroupType = PartitionGroupConfig.MemberGroupType.PER_MEMBER; } } }
public ConfigCheck(Config config, String joinerType) { this.joinerType = joinerType; // Copying all properties relevant for checking properties.put(PARTITION_COUNT.getName(), config.getProperty(PARTITION_COUNT.getName())); properties.put(APPLICATION_VALIDATION_TOKEN.getName(), config.getProperty(APPLICATION_VALIDATION_TOKEN.getName())); // Copying group-config settings GroupConfig groupConfig = config.getGroupConfig(); if (groupConfig != null) { this.groupName = groupConfig.getName(); } // Partition-group settings final PartitionGroupConfig partitionGroupConfig = config.getPartitionGroupConfig(); if (partitionGroupConfig != null) { partitionGroupEnabled = partitionGroupConfig.isEnabled(); if (partitionGroupEnabled) { memberGroupType = partitionGroupConfig.getGroupType(); } else { memberGroupType = PartitionGroupConfig.MemberGroupType.PER_MEMBER; } } }
private static void partitionGroupXmlGenerator(XmlGenerator gen, Config config) { PartitionGroupConfig pg = config.getPartitionGroupConfig(); if (pg == null) { return; } gen.open("partition-group", "enabled", pg.isEnabled(), "group-type", pg.getGroupType()); Collection<MemberGroupConfig> configs = pg.getMemberGroupConfigs(); if (CollectionUtil.isNotEmpty(configs)) { for (MemberGroupConfig mgConfig : configs) { gen.open("member-group"); for (String iface : mgConfig.getInterfaces()) { gen.node("interface", iface); } gen.close(); } } gen.close(); }
config.getPartitionGroupConfig() .setEnabled(true) .setGroupType(ZONE_AWARE);
private static void partitionGroupXmlGenerator(XmlGenerator gen, Config config) { PartitionGroupConfig pg = config.getPartitionGroupConfig(); if (pg == null) { return; } gen.open("partition-group", "enabled", pg.isEnabled(), "group-type", pg.getGroupType()); Collection<MemberGroupConfig> configs = pg.getMemberGroupConfigs(); if (CollectionUtil.isNotEmpty(configs)) { for (MemberGroupConfig mgConfig : configs) { gen.open("member-group"); for (String iface : mgConfig.getInterfaces()) { gen.node("interface", iface); } gen.close(); } } gen.close(); }