HoustonPutman commented on PR #1650:
URL: https://github.com/apache/solr/pull/1650#issuecomment-1582635343

   So this should be ready to start reviewing.
   
   It still needs testing and docs, but I don't want to do that until the 
design has a +1 from others.
   
   This PR now shifts the existing PlacementPlugins to be subclasses of 
OrderedNodePlacementPlugin, which gives default implementations of 
`computePlacements()` and `computeBalancing()`. These subclasses merely need to 
implement a `getWeightedNodes()` method, which returns a mapping from `Node` to 
`WeightedNode`. Each plugin makes its own implementation of `WeightedNode`, 
because the "weighting" is determined by what that plugin wants to prioritize 
when making selections.
   
   The `WeightedNode` abstract class has become a bit bloated, but basically it 
allows a Node to keep track of a state, and make an overall "weight" for that 
node with the given state. (It also has a method to project relevant weight 
with a given replica added, that's what used for `computePlacements()`).
   
   I'm sure I need to do a lot more explanation, but in general, the given 
plugins should work almost exactly as they do today, with the added benefit of 
having `computeBalancing()` come for "free". (though I'm sure the 
implementation of that shared method can be improved with time)
   
   This OrderedNodePlacementPlugin is just a class that the existing 
PlacementPlugins extend, so it is back-compat with custom plugins. We should 
mark the class expirimental for 9.x, so that we can make improvements to 
OrderedNodePlacementPlugin without having to worry about back-compat guarantees 
while we are improving these APIs. (e.g., the WeightedNode class may need 
additional methods if we want to make improvements to the sorting).
   
   I'm also happy to split the `OrderedNodePlacementPlugin` changes into its 
own PR, so that it can be reviewed independently of the BalanceReplica code. 
Let me know what you think!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to