pub(crate) async fn build_datanode_plan(
table_metadata_manager: &TableMetadataManagerRef,
node_id: DatanodeId,
) -> Result<DrainDatanodePlan>Expand description
Builds the drain plan of node_id.
Walks the datanode table index and reads the authoritative table routes, so the plan
reflects the routes rather than the index. Each table route is split by role with
region_distribution, which keys the regions by datanode id.