Class AffinityPlacementConfig
- java.lang.Object
-
- org.apache.solr.cluster.placement.plugins.AffinityPlacementConfig
-
- All Implemented Interfaces:
PlacementPluginConfig
,org.apache.solr.common.MapSerializable
,org.apache.solr.common.MapWriter
,org.apache.solr.common.NavigableObject
,org.apache.solr.common.util.ReflectMapWriter
public class AffinityPlacementConfig extends Object implements PlacementPluginConfig
Configuration bean forAffinityPlacementFactory
.
-
-
Field Summary
Fields Modifier and Type Field Description static String
AVAILABILITY_ZONE_SYSPROP
Name of the system property on a node indicating which (public cloud) Availability Zone that node is in.Map<String,String>
collectionNodeType
This property defines an additional constraint that the collection must be placed only on the nodes of the correct "node type".static AffinityPlacementConfig
DEFAULT
static long
DEFAULT_MINIMAL_FREE_DISK_GB
static long
DEFAULT_PRIORITIZED_FREE_DISK_GB
long
minimalFreeDiskGB
If a node has strictly less GB of free disk than this value, the node is excluded from assignment decisions.static String
NODE_TYPE_SYSPROP
Name of the system property on a node indicating the arbitrary "node type" (for example, a node more suitable for the indexing work load could be labeled asnode_type: indexing
).long
prioritizedFreeDiskGB
Replica allocation will assign replicas to nodes with at least this number of GB of free disk space regardless of the number of cores on these nodes rather than assigning replicas to nodes with less than this amount of free disk space if that's an option (if that's not an option, replicas can still be assigned to nodes with less than this amount of free space).static String
REPLICA_TYPE_SYSPROP
Name of the system property on a node indicating the type of replicas allowed on that node.static String
UNDEFINED_AVAILABILITY_ZONE
This is the "AZ" name for nodes that do not define an AZ.Map<String,String>
withCollection
This property defines an additional constraint that primary collections (keys) should be located on the same nodes as the secondary collections (values).
-
Constructor Summary
Constructors Constructor Description AffinityPlacementConfig()
Zero-arguments public constructor required for deserialization - don't use.AffinityPlacementConfig(long minimalFreeDiskGB, long prioritizedFreeDiskGB)
Configuration for theAffinityPlacementFactory
.AffinityPlacementConfig(long minimalFreeDiskGB, long prioritizedFreeDiskGB, Map<String,String> withCollection, Map<String,String> collectionNodeType)
Configuration for theAffinityPlacementFactory
.
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
DEFAULT_MINIMAL_FREE_DISK_GB
public static final long DEFAULT_MINIMAL_FREE_DISK_GB
- See Also:
- Constant Field Values
-
DEFAULT_PRIORITIZED_FREE_DISK_GB
public static final long DEFAULT_PRIORITIZED_FREE_DISK_GB
- See Also:
- Constant Field Values
-
DEFAULT
public static final AffinityPlacementConfig DEFAULT
-
AVAILABILITY_ZONE_SYSPROP
public static final String AVAILABILITY_ZONE_SYSPROP
Name of the system property on a node indicating which (public cloud) Availability Zone that node is in. The value is any string, different strings denote different availability zones.Nodes on which this system property is not defined are considered being in the same Availability Zone
UNDEFINED_AVAILABILITY_ZONE
(hopefully the value of this constant is not the name of a real Availability Zone :).- See Also:
- Constant Field Values
-
REPLICA_TYPE_SYSPROP
public static final String REPLICA_TYPE_SYSPROP
Name of the system property on a node indicating the type of replicas allowed on that node. The value of that system property is a comma separated list or a single string of value names ofReplica.ReplicaType
(case insensitive). If that property is not defined, that node is considered accepting all replica types (i.e. undefined is equivalent to"NRT,Pull,tlog"
).- See Also:
- Constant Field Values
-
NODE_TYPE_SYSPROP
public static final String NODE_TYPE_SYSPROP
Name of the system property on a node indicating the arbitrary "node type" (for example, a node more suitable for the indexing work load could be labeled asnode_type: indexing
). The value of this system property is a comma-separated list or a single label (labels must not contain commas), which represent a logical OR for the purpose of placement.- See Also:
- Constant Field Values
-
UNDEFINED_AVAILABILITY_ZONE
public static final String UNDEFINED_AVAILABILITY_ZONE
This is the "AZ" name for nodes that do not define an AZ. Should not match a real AZ name (I think we're safe)- See Also:
- Constant Field Values
-
minimalFreeDiskGB
public long minimalFreeDiskGB
If a node has strictly less GB of free disk than this value, the node is excluded from assignment decisions. Set to 0 or less to disable.
-
prioritizedFreeDiskGB
public long prioritizedFreeDiskGB
Replica allocation will assign replicas to nodes with at least this number of GB of free disk space regardless of the number of cores on these nodes rather than assigning replicas to nodes with less than this amount of free disk space if that's an option (if that's not an option, replicas can still be assigned to nodes with less than this amount of free space).
-
withCollection
public Map<String,String> withCollection
This property defines an additional constraint that primary collections (keys) should be located on the same nodes as the secondary collections (values). The plugin will assume that the secondary collection replicas are already in place and ignore candidate nodes where they are not already present.
-
collectionNodeType
public Map<String,String> collectionNodeType
This property defines an additional constraint that the collection must be placed only on the nodes of the correct "node type". The nodes can specify what type they are (one or several types, using a comma-separated list) by defining theNODE_TYPE_SYSPROP
system property. Similarly, the plugin can be configured to specify that a collection (key in the map) must be placed on one or more node type (value in the map, using comma-separated list of acceptable node types).
-
-
Constructor Detail
-
AffinityPlacementConfig
public AffinityPlacementConfig()
Zero-arguments public constructor required for deserialization - don't use.
-
AffinityPlacementConfig
public AffinityPlacementConfig(long minimalFreeDiskGB, long prioritizedFreeDiskGB)
Configuration for theAffinityPlacementFactory
.- Parameters:
minimalFreeDiskGB
- minimal free disk GB.prioritizedFreeDiskGB
- prioritized free disk GB.
-
AffinityPlacementConfig
public AffinityPlacementConfig(long minimalFreeDiskGB, long prioritizedFreeDiskGB, Map<String,String> withCollection, Map<String,String> collectionNodeType)
Configuration for theAffinityPlacementFactory
.- Parameters:
minimalFreeDiskGB
- minimal free disk GB.prioritizedFreeDiskGB
- prioritized free disk GB.withCollection
- configuration of co-located collections: keys are primary collection names and values are secondary collection names.collectionNodeType
- configuration of reequired node types per collection. Keys are collection names and values are comma-separated lists of required node types.
-
-