/** * Sets the system management partition group. * <p> * The system management group must be configured for stateful instances. This group will be used to store primitive * and transaction metadata and coordinate primary elections for replication protocols. * <pre> * {@code * Atomix atomix = Atomix.builder() * .withManagementGroup(RaftPartitionGroup.builder("system") * .withNumPartitions(1) * .build()) * .build(); * } * </pre> * <p> * The configured partition group is replicated on whichever nodes define them in this configuration. That is, * this node will participate in whichever partition group is provided to this method. * <p> * The management group can also be configured in {@code atomix.conf} under the {@code management-group} key. * * @param systemManagementGroup the system management partition group * @return the Atomix builder */ public AtomixBuilder withManagementGroup(ManagedPartitionGroup systemManagementGroup) { config.setManagementGroup(systemManagementGroup.config()); return this; }
/** * Sets the primitive partition groups. * <p> * The primitive partition groups represent partitions that are directly accessible to distributed primitives. To use * partitioned primitives, at least one node must be configured with at least one data partition group. * <pre> * {@code * Atomix atomix = Atomix.builder() * .withPartitionGroups(PrimaryBackupPartitionGroup.builder("data") * .withNumPartitions(32) * .build()) * .build(); * } * </pre> * The partition group name is used to uniquely identify the group when constructing primitive instances. Partitioned * primitives will reference a specific protocol and partition group within which to replicate the primitive. * <p> * The configured partition groups are replicated on whichever nodes define them in this configuration. That is, * this node will participate in whichever partition groups are provided to this method. * <p> * The partition groups can also be configured in {@code atomix.conf} under the {@code partition-groups} key. * * @param partitionGroups the partition groups * @return the Atomix builder * @throws NullPointerException if the partition groups are null */ public AtomixBuilder withPartitionGroups(Collection<ManagedPartitionGroup> partitionGroups) { partitionGroups.forEach(group -> config.addPartitionGroup(group.config())); return this; }
config.addPartitionGroup(partitionGroup.config()); return this;
? new PartitionGroupMembership( systemGroup.name(), systemGroup.config(), ImmutableSet.of(membershipService.getLocalMember().id()), true) : null; groups.forEach(group -> { this.groups.put(group.name(), new PartitionGroupMembership( group.name(), group.config(), ImmutableSet.of(membershipService.getLocalMember().id()), false)); });
/** * Sets the system management partition group. * <p> * The system management group must be configured for stateful instances. This group will be used to store primitive * and transaction metadata and coordinate primary elections for replication protocols. * <pre> * {@code * Atomix atomix = Atomix.builder() * .withManagementGroup(RaftPartitionGroup.builder("system") * .withNumPartitions(1) * .build()) * .build(); * } * </pre> * <p> * The configured partition group is replicated on whichever nodes define them in this configuration. That is, * this node will participate in whichever partition group is provided to this method. * <p> * The management group can also be configured in {@code atomix.conf} under the {@code management-group} key. * * @param systemManagementGroup the system management partition group * @return the Atomix builder */ public AtomixBuilder withManagementGroup(ManagedPartitionGroup systemManagementGroup) { config.setManagementGroup(systemManagementGroup.config()); return this; }
config.addPartitionGroup(partitionGroup.config()); return this;
/** * Sets the primitive partition groups. * <p> * The primitive partition groups represent partitions that are directly accessible to distributed primitives. To use * partitioned primitives, at least one node must be configured with at least one data partition group. * <pre> * {@code * Atomix atomix = Atomix.builder() * .withPartitionGroups(PrimaryBackupPartitionGroup.builder("data") * .withNumPartitions(32) * .build()) * .build(); * } * </pre> * The partition group name is used to uniquely identify the group when constructing primitive instances. Partitioned * primitives will reference a specific protocol and partition group within which to replicate the primitive. * <p> * The configured partition groups are replicated on whichever nodes define them in this configuration. That is, * this node will participate in whichever partition groups are provided to this method. * <p> * The partition groups can also be configured in {@code atomix.conf} under the {@code partition-groups} key. * * @param partitionGroups the partition groups * @return the Atomix builder * @throws NullPointerException if the partition groups are null */ public AtomixBuilder withPartitionGroups(Collection<ManagedPartitionGroup> partitionGroups) { partitionGroups.forEach(group -> config.addPartitionGroup(group.config())); return this; }