[
https://issues.apache.org/jira/browse/SOLR-12756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16630126#comment-16630126
]
Shalin Shekhar Mangar commented on SOLR-12756:
----------------------------------------------
Final patch that removes all nocommits and passes all tests. There is still a
lot of cleanup required especially in the way that maxShardsPerNode is
validated in various APIs. But I have more pressing items to work on so I am
going to stop at this point.
The assignment is done this way now (taken from CreateCollectionCmd):
{code}
Assign.AssignRequest assignRequest = new Assign.AssignRequestBuilder()
.forCollection(collectionName)
.forShard(shardNames)
.assignNrtReplicas(numNrtReplicas)
.assignTlogReplicas(numTlogReplicas)
.assignPullReplicas(numPullReplicas)
.onNodes(nodeList)
.build();
Assign.AssignStrategyFactory assignStrategyFactory = new
Assign.AssignStrategyFactory(cloudManager);
Assign.AssignStrategy assignStrategy =
assignStrategyFactory.create(clusterState, docCollection);
replicaPositions = assignStrategy.assign(cloudManager, assignRequest);
{code}
There is still a getNodesForNewReplicas method in Assign class which is only
used by Add Replica. I kept it separate to avoid adding more code into
AddReplicaCmd (it is already pretty complex).
> Refactor Assign and extract replica placement strategies out of it
> ------------------------------------------------------------------
>
> Key: SOLR-12756
> URL: https://issues.apache.org/jira/browse/SOLR-12756
> Project: Solr
> Issue Type: Task
> Security Level: Public(Default Security Level. Issues are Public)
> Components: SolrCloud
> Reporter: Shalin Shekhar Mangar
> Assignee: Shalin Shekhar Mangar
> Priority: Minor
> Fix For: 7.6, master (8.0)
>
> Attachments: SOLR-12756.patch, SOLR-12756.patch, SOLR-12756.patch,
> SOLR-12756.patch
>
>
> While working on SOLR-12648, I found Assign class to be very complex. Many
> methods have overlapping functionality, differ in side-effects and have
> non-intuitive arguments. We should clean this up and extract replica
> placement strategies out of that class.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]