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