Class Builders.CollectionBuilder
- java.lang.Object
-
- org.apache.solr.cluster.placement.Builders.CollectionBuilder
-
-
Constructor Summary
Constructors Constructor Description CollectionBuilder(String collectionName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Builders.CollectionBuilder
addCustomProperty(String name, String value)
org.apache.solr.cluster.SolrCollection
build()
Builders.CollectionBuilder
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.CollectionMetricsBuilder
getCollectionMetricsBuilder()
List<Builders.ShardBuilder>
getShardBuilders()
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.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.
-
-
-
Constructor Detail
-
CollectionBuilder
public CollectionBuilder(String collectionName)
-
-
Method Detail
-
addCustomProperty
public Builders.CollectionBuilder addCustomProperty(String name, String value)
-
getCollectionMetricsBuilder
public org.apache.solr.cluster.placement.impl.CollectionMetricsBuilder getCollectionMetricsBuilder()
-
getShardBuilders
public List<Builders.ShardBuilder> 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()
-
-