Make tikv-server fully generic over kv engines (#10945)
Make tikv-server fully generic over kv engines (#10945)

* server: Allow flow_info_receiver to be None

Signed-off-by: Brian Anderson <andersrb@gmail.com>

* server: Move init_flow_receiver call into init_raw_engines

Signed-off-by: Brian Anderson <andersrb@gmail.com>

* server: Extract debug service creation to CreateKvEngine::start_debug_service

Signed-off-by: Brian Anderson <andersrb@gmail.com>

* server: Extract backup service creation to CreateKvEngine::start_backup_service

Signed-off-by: Brian Anderson <andersrb@gmail.com>

* server: Extract rocks cfg controller registration to CreateKvEngine::register_kv_config

Signed-off-by: Brian Anderson <andersrb@gmail.com>

* server: Extract create_raftstore_compaction_listener to free function

Signed-off-by: Brian Anderson <andersrb@gmail.com>

* server: Extract create_kv_engine to CreateKvEngine trait

Signed-off-by: Brian Anderson <andersrb@gmail.com>

* server: Parameterize EngineResourceInfo over EK

Signed-off-by: Brian Anderson <andersrb@gmail.com>

* server: Parameterize TikvServer over EK

Signed-off-by: Brian Anderson <andersrb@gmail.com>

* server: Document CreateKvEngine trait

Signed-off-by: Brian Anderson <andersrb@gmail.com>

* clippy

Signed-off-by: Brian Anderson <andersrb@gmail.com>

* server: Extract raft engine creation to CreateRaftEngine::create_raft_engine

Signed-off-by: Brian Anderson <andersrb@gmail.com>

* server: Extract CreateRaftEngine::register_raft_config method

Signed-off-by: Brian Anderson <andersrb@gmail.com>

* server: Extract CreateRaftEngine::create_engine_infos method

Signed-off-by: Brian Anderson <andersrb@gmail.com>

* server: Unspecialize init_raw_engines method

Signed-off-by: Brian Anderson <andersrb@gmail.com>

* server: Extract setup code to generic run_server function

Signed-off-by: Brian Anderson <andersrb@gmail.com>

* clippy

ref #6402

Signed-off-by: Brian Anderson <andersrb@gmail.com>

Co-authored-by: Ti Chi Robot <040e6455cde1c91e876ec337e785ce913eacba35@tidb.io>
BusyJay/tikv,BusyJay/tikv,BusyJay/tikv,BusyJay/tikv