Class Builders.CollectionBuilder
java.lang.Object
org.apache.solr.cluster.placement.Builders.CollectionBuilder
- Enclosing class:
Builders
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCustomProperty(String name, String value) org.apache.solr.cluster.SolrCollectionbuild()customCollectionSetup(List<List<String>> shardsReplicas, List<Builders.NodeBuilder> liveNodes) Initializes the collection to a specific shard and replica distribution passed inshardsReplicas.org.apache.solr.cluster.placement.impl.CollectionMetricsBuilderinitializeShardsReplicas(int countShards, int countNrtReplicas, int countTlogReplicas, int countPullReplicas, List<Builders.NodeBuilder> nodes) Initializes shard and replica builders for the collection based on passed parameters.initializeShardsReplicas(int countShards, int countNrtReplicas, int countTlogReplicas, int countPullReplicas, List<Builders.NodeBuilder> nodes, List<Integer> initialSizeGBPerShard) Initializes shard and replica builders for the collection based on passed parameters.
-
Constructor Details
-
CollectionBuilder
-
-
Method Details
-
addCustomProperty
-
getCollectionMetricsBuilder
public org.apache.solr.cluster.placement.impl.CollectionMetricsBuilder getCollectionMetricsBuilder() -
getShardBuilders
- Returns:
- The internal shards data structure to allow test code to modify the replica distribution to nodes.
-
customCollectionSetup
public Builders.CollectionBuilder customCollectionSetup(List<List<String>> shardsReplicas, List<Builders.NodeBuilder> liveNodes) Initializes the collection to a specific shard and replica distribution passed inshardsReplicas.- Parameters:
shardsReplicas- A list of shard descriptions, describing the replicas of that shard. Replica description include the replica type and the node on which the replica should be placed. Everything is text to make it easy to design specific collections. For example the following value:
Creates a placement that would distribute replicas to nodes (there must be at least 4 nodes) in the following way:List.of( List.of("NRT 0", "TLOG 0", "NRT 3"), // shard 1 List.of("NRT 1", "NRT 3", "TLOG 2")); // shard 2+--------------+----+----+----+----+ | Node | 0 | 1 | 2 | 3 | +----------------------------------+ | Shard 1: | | | | | | NRT | X | | | X | | TLOG | X | | | | +----------------------------------+ | Shard 2: | | | | | | NRT | | X | | X | | TLOG | | | X | | +--------------+----+----+----+----+
-
initializeShardsReplicas
public Builders.CollectionBuilder initializeShardsReplicas(int countShards, int countNrtReplicas, int countTlogReplicas, int countPullReplicas, List<Builders.NodeBuilder> nodes) Initializes shard and replica builders for the collection based on passed parameters. Replicas are assigned round-robin to the nodes. The shard leader is the first NRT replica of each shard (or first TLOG is no NRT). Shard and replica configuration can be modified afterwards, the returned builder hierarchy is a convenient starting point.- Parameters:
countShards- number of shards to createcountNrtReplicas- number of NRT replicas per shardcountTlogReplicas- number of TLOG replicas per shardcountPullReplicas- number of PULL replicas per shardnodes- list of nodes to place replicas on.
-
initializeShardsReplicas
public Builders.CollectionBuilder initializeShardsReplicas(int countShards, int countNrtReplicas, int countTlogReplicas, int countPullReplicas, List<Builders.NodeBuilder> nodes, List<Integer> initialSizeGBPerShard) Initializes shard and replica builders for the collection based on passed parameters. Replicas are assigned round-robin to the nodes. The shard leader is the first NRT replica of each shard (or first TLOG is no NRT). Shard and replica configuration can be modified afterwards, the returned builder hierarchy is a convenient starting point.- Parameters:
countShards- number of shards to createcountNrtReplicas- number of NRT replicas per shardcountTlogReplicas- number of TLOG replicas per shardcountPullReplicas- number of PULL replicas per shardnodes- list of nodes to place replicas on.initialSizeGBPerShard- initial replica size (in GB) per shard
-
build
public org.apache.solr.cluster.SolrCollection build()
-