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,org.noggit.JSONWriter.Writable
Configuration bean for
AffinityPlacementFactory.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.solr.common.MapWriter
org.apache.solr.common.MapWriter.EntryWriter -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of the system property on a node indicating which (public cloud) Availability Zone that node is in.This property defines an additional constraint that the collection must be placed only on the nodes of the correct "node type".static final AffinityPlacementConfigstatic final longstatic final longDetermines the maximum number of replicas of a particular type of a particular shard that can be placed within a single domain (as defined by the @link #SPREAD_DOMAIN_SYSPROP} System property.longIf a node has strictly less GB of free disk than this value, the node is excluded from assignment decisions.static final StringName 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).longReplica 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 final StringName of the system property on a node indicating the type of replicas allowed on that node.static final StringName of the system property on a node indicating the spread domain group.When this property is set totrue, Solr will try to place replicas for the same shard in nodes that have different value for theSPREAD_DOMAIN_SYSPROPSystem property.static final StringThis is the "AZ" name for nodes that do not define an AZ.This property defines an additional constraint that primary collections (keys) should be located on the same nodes as the secondary collections (values).Same aswithCollectionbut ensures shard to shard correspondence.Fields inherited from interface org.apache.solr.common.MapWriter
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionZero-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) AffinityPlacementConfig(long minimalFreeDiskGB, long prioritizedFreeDiskGB, Map<String, String> withCollection, Map<String, String> withCollectionShards, 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, waitMethods inherited from interface org.apache.solr.common.MapWriter
jsonStr, toMap, writeMethods inherited from interface org.apache.solr.common.NavigableObject
_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr, _sizeMethods inherited from interface org.apache.solr.common.util.ReflectMapWriter
writeMap
-
Field Details
-
DEFAULT_MINIMAL_FREE_DISK_GB
public static final long DEFAULT_MINIMAL_FREE_DISK_GB- See Also:
-
DEFAULT_PRIORITIZED_FREE_DISK_GB
public static final long DEFAULT_PRIORITIZED_FREE_DISK_GB- See Also:
-
DEFAULT
-
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:
-
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:
-
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:
-
SPREAD_DOMAIN_SYSPROP
Name of the system property on a node indicating the spread domain group. This is used (ifspreadAcrossDomainsis set to true) to indicate this placement plugin that replicas for a particular shard should spread across nodes that have different values for this system property.- See Also:
-
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:
-
minimalFreeDiskGB
public long minimalFreeDiskGBIf 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 prioritizedFreeDiskGBReplica 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
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
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_SYSPROPsystem 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). -
withCollectionShards
Same aswithCollectionbut ensures shard to shard correspondence. should be disjoint withwithCollection. -
spreadAcrossDomains
When this property is set totrue, Solr will try to place replicas for the same shard in nodes that have different value for theSPREAD_DOMAIN_SYSPROPSystem property. If more replicas exist (or are being placed) than the number of different values forSPREAD_DOMAIN_SYSPROPSystem property in nodes in the cluster, Solr will attempt to distribute the placement of the replicas evenly across the domains but will fail the placement if more thanmaxReplicasPerShardInDomainare placed within a single domain. Note that the domain groups are evaluated within a particular AZ (i.e. Solr will not consider the placement of replicas in AZ1 when selecting candidate nodes for replicas in AZ2). Example usages for this config are:- Rack diversity: You want replicas in different AZs but also, within the AZ you want them in different racks
- Host diversity: You are running multiple Solr instances in the same host physical host. You want replicas in different AZs but also, within an AZ you want replicas for the same shard to go in nodes that run in different hosts
-
maxReplicasPerShardInDomain
Determines the maximum number of replicas of a particular type of a particular shard that can be placed within a single domain (as defined by the @link #SPREAD_DOMAIN_SYSPROP} System property.
-
-
Constructor Details
-
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> withCollectionShards, 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.
-
AffinityPlacementConfig
-
-
Method Details
-
validate
public void validate()
-