apache / helix

Mirror of Apache Helix
Apache License 2.0
467 stars 228 forks source link

Support user-defined TaskAssignmentCalculator #2830

Open AlecHenx opened 4 months ago

AlecHenx commented 4 months ago

Is your feature request related to a problem? Please describe.

I found that resource rebalance function can be user-defined, but task not. There is no way to constrain a task binding to a machine that I want.

Describe the solution you'd like

Similar to replica resource balance function, it could be better to develop an option for user to specify a TaskAssignmentCalculator for rebalancing.

Additional context empty

AlecHenx commented 4 months ago

I found that maybe I can use [Instance Group] to implement this requirement. But my logic is more complex.

Fisrtly, I have bunch of instances and bunch of tasks. Each task has a preference of instance, like task1 -> ins2, task2 -> ins3. Here is my assignment logic, 1.Use the preference to assign. 2.If the instance is crashed, then randomly select a instance to assign.

How can I use helix's built-in function to implement this feature?

Thank you very much!

junkaixue commented 4 months ago

Thanks for asking it. Will see whether any contributors would like to take this task.