Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding in maxShardsPerNode when creating collection. #79

Merged
merged 2 commits into from
Feb 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion controllers/solrcollection_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func reconcileSolrCollection(r *SolrCollectionReconciler, collection *solrv1beta

// Request the creation of collection by calling solr
collection.Status.InProgressCreation = true
create, err := util.CreateCollection(solrCloud.Name, collection.Name, numShards, replicationFactor, autoAddReplicas, routerName, routerField, shards, collectionConfigName, namespace)
create, err := util.CreateCollection(solrCloud.Name, collection.Name, numShards, replicationFactor, autoAddReplicas, maxShardsPerNode, routerName, routerField, shards, collectionConfigName, namespace)
if err != nil {
collection.Status.InProgressCreation = false
return nil, false, err
Expand Down
4 changes: 3 additions & 1 deletion controllers/util/collection_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ import (
)

// CreateCollection to request collection creation on SolrCloud
func CreateCollection(cloud string, collection string, numShards int64, replicationFactor int64, autoAddReplicas bool, routerName string, routerField string, shards string, collectionConfigName string, namespace string) (success bool, err error) {
func CreateCollection(cloud string, collection string, numShards int64, replicationFactor int64, autoAddReplicas bool, maxShardsPerNode int64, routerName string, routerField string, shards string, collectionConfigName string, namespace string) (success bool, err error) {
queryParams := url.Values{}
replicationFactorParameter := strconv.FormatInt(replicationFactor, 10)
numShardsParameter := strconv.FormatInt(numShards, 10)
maxShardsPerNodeParameter := strconv.FormatInt(maxShardsPerNode, 10)
queryParams.Add("action", "CREATE")
queryParams.Add("name", collection)
queryParams.Add("replicationFactor", replicationFactorParameter)
queryParams.Add("maxShardsPerNode", maxShardsPerNodeParameter)
queryParams.Add("autoAddReplicas", strconv.FormatBool(autoAddReplicas))
queryParams.Add("collection.configName", collectionConfigName)
queryParams.Add("router.field", routerField)
Expand Down