@@ -2817,10 +2817,10 @@ TChangefeedDescription TChangefeedDescription::FromProto(const TProto& proto) {
2817
2817
return ret;
2818
2818
}
2819
2819
2820
- void TChangefeedDescription::SerializeTo (Ydb::Table::Changefeed& proto) const {
2820
+ template <typename TProto>
2821
+ void TChangefeedDescription::SerializeCommonFields (TProto& proto) const {
2821
2822
proto.set_name (TStringType{Name_});
2822
2823
proto.set_virtual_timestamps (VirtualTimestamps_);
2823
- proto.set_initial_scan (InitialScan_);
2824
2824
proto.set_aws_region (TStringType{AwsRegion_});
2825
2825
2826
2826
switch (Mode_) {
@@ -2861,12 +2861,35 @@ void TChangefeedDescription::SerializeTo(Ydb::Table::Changefeed& proto) const {
2861
2861
SetDuration (*ResolvedTimestamps_, *proto.mutable_resolved_timestamps_interval ());
2862
2862
}
2863
2863
2864
+ for (const auto & [key, value] : Attributes_) {
2865
+ (*proto.mutable_attributes ())[key] = value;
2866
+ }
2867
+ }
2868
+
2869
+ void TChangefeedDescription::SerializeTo (Ydb::Table::Changefeed& proto) const {
2870
+ SerializeCommonFields (proto);
2871
+ proto.set_initial_scan (InitialScan_);
2872
+
2864
2873
if (RetentionPeriod_) {
2865
2874
SetDuration (*RetentionPeriod_, *proto.mutable_retention_period ());
2866
2875
}
2876
+ }
2867
2877
2868
- for (const auto & [key, value] : Attributes_) {
2869
- (*proto.mutable_attributes ())[key] = value;
2878
+ void TChangefeedDescription::SerializeTo (Ydb::Table::ChangefeedDescription& proto) const {
2879
+ SerializeCommonFields (proto);
2880
+
2881
+ switch (State_) {
2882
+ case EChangefeedState::Enabled:
2883
+ proto.set_state (Ydb::Table::ChangefeedDescription_State::ChangefeedDescription_State_STATE_ENABLED);
2884
+ break ;
2885
+ case EChangefeedState::Disabled:
2886
+ proto.set_state (Ydb::Table::ChangefeedDescription_State::ChangefeedDescription_State_STATE_DISABLED);
2887
+ break ;
2888
+ case EChangefeedState::InitialScan:
2889
+ proto.set_state (Ydb::Table::ChangefeedDescription_State::ChangefeedDescription_State_STATE_INITIAL_SCAN);
2890
+ break ;
2891
+ case EChangefeedState::Unknown:
2892
+ break ;
2870
2893
}
2871
2894
}
2872
2895
0 commit comments