risingwave_meta/hummock/model/
compaction_status.rs1use itertools::Itertools;
16
17use crate::hummock::compaction::CompactStatus;
18
19impl From<&CompactStatus> for risingwave_pb::hummock::CompactStatus {
20 fn from(status: &CompactStatus) -> Self {
21 risingwave_pb::hummock::CompactStatus {
22 compaction_group_id: status.compaction_group_id,
23 level_handlers: status.level_handlers.iter().map_into().collect(),
24 }
25 }
26}
27
28impl From<CompactStatus> for risingwave_pb::hummock::CompactStatus {
29 fn from(status: CompactStatus) -> Self {
30 (&status).into()
31 }
32}
33
34impl From<&risingwave_pb::hummock::CompactStatus> for CompactStatus {
35 fn from(status: &risingwave_pb::hummock::CompactStatus) -> Self {
36 CompactStatus {
37 compaction_group_id: status.compaction_group_id,
38 level_handlers: status.level_handlers.iter().map_into().collect(),
39 }
40 }
41}