Skip to content

Commit

Permalink
Adding in maxShardsPerNode when creating collection. (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
HoustonPutman authored Feb 21, 2020
1 parent 9c37aaa commit 5b380dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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

0 comments on commit 5b380dc

Please sign in to comment.