horaedb
horaedb copied to clipboard
Centralize the logic of choosing worker for table into one place
Describe This Problem
When carry on operations (write, flush etc.) on one table, a specific worker should be chosen. However, the logic for choosing such a worker distributes across the codebase:
https://github.com/CeresDB/ceresdb/blob/ccf988f5629436927479721b63df53b220967160/analytic_engine/src/instance/write_worker.rs#L307
https://github.com/CeresDB/ceresdb/blob/ccf988f5629436927479721b63df53b220967160/analytic_engine/src/instance/write_worker.rs#L669
https://github.com/CeresDB/ceresdb/blob/ccf988f5629436927479721b63df53b220967160/analytic_engine/src/table/data.rs#L541
Proposal
We hope the logic of choosing the worker for a specific table should be centralized in one place (one function).
Additional Context
No response