risingwave_hummock_sdk/
state_table_info.rs1use risingwave_pb::hummock::PbStateTableInfo;
16use risingwave_pb::id::CompactionGroupId;
17use serde::{Deserialize, Serialize};
18
19#[derive(Serialize, Deserialize, Clone)]
20pub struct StateTableInfo {
21 #[serde(default)]
22 pub committed_epoch: u64,
23 #[serde(default)]
24 pub compaction_group_id: CompactionGroupId,
25}
26
27impl From<StateTableInfo> for PbStateTableInfo {
28 fn from(i: StateTableInfo) -> Self {
29 (&i).into()
30 }
31}
32
33impl From<&StateTableInfo> for PbStateTableInfo {
34 fn from(i: &StateTableInfo) -> Self {
35 Self {
36 committed_epoch: i.committed_epoch,
37 compaction_group_id: i.compaction_group_id,
38 }
39 }
40}
41
42impl From<PbStateTableInfo> for StateTableInfo {
43 fn from(i: PbStateTableInfo) -> Self {
44 (&i).into()
45 }
46}
47
48impl From<&PbStateTableInfo> for StateTableInfo {
49 fn from(i: &PbStateTableInfo) -> Self {
50 Self {
51 committed_epoch: i.committed_epoch,
52 compaction_group_id: i.compaction_group_id,
53 }
54 }
55}