Package io.atomix.primitive.partition
Enum Class MemberGroupStrategy
- All Implemented Interfaces:
MemberGroupProvider,Serializable,Comparable<MemberGroupStrategy>,Constable
Member group strategy.
Member group strategies are default implementations of MemberGroupProvider for
built-in node attributes.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionHost aware member group strategy.Node aware member group strategy (the default).Rack aware member group strategy.Zone aware member group strategy. -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<MemberGroup>groupNodes(Collection<Member> members, Function<Member, String> keyFunction) Groups nodes by the given key function.static MemberGroupStrategyReturns the enum constant of this class with the specified name.static MemberGroupStrategy[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface io.atomix.primitive.partition.MemberGroupProvider
getMemberGroups
-
Enum Constant Details
-
ZONE_AWARE
Zone aware member group strategy.This strategy will create a member group for each unique zone in the cluster.
-
RACK_AWARE
Rack aware member group strategy.This strategy will create a member group for each unique rack in the cluster.
-
HOST_AWARE
Host aware member group strategy.This strategy will create a member group for each unique host in the cluster.
-
NODE_AWARE
Node aware member group strategy (the default).This strategy will create a member group for each node in the cluster, effectively behaving the same as if no member groups were defined.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
groupNodes
protected Collection<MemberGroup> groupNodes(Collection<Member> members, Function<Member, String> keyFunction) Groups nodes by the given key function.- Parameters:
members- the nodes to groupkeyFunction- the key function to apply to nodes to extract a key- Returns:
- a collection of node member groups
-