@@ -2817,10 +2817,10 @@ TChangefeedDescription TChangefeedDescription::FromProto(const TProto& proto) {
28172817 return ret;
28182818}
28192819
2820- void TChangefeedDescription::SerializeTo (Ydb::Table::Changefeed& proto) const {
2820+ template <typename TProto>
2821+ void TChangefeedDescription::SerializeCommonFields (TProto& proto) const {
28212822 proto.set_name (TStringType{Name_});
28222823 proto.set_virtual_timestamps (VirtualTimestamps_);
2823- proto.set_initial_scan (InitialScan_);
28242824 proto.set_aws_region (TStringType{AwsRegion_});
28252825
28262826 switch (Mode_) {
@@ -2861,12 +2861,35 @@ void TChangefeedDescription::SerializeTo(Ydb::Table::Changefeed& proto) const {
28612861 SetDuration (*ResolvedTimestamps_, *proto.mutable_resolved_timestamps_interval ());
28622862 }
28632863
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+
28642873 if (RetentionPeriod_) {
28652874 SetDuration (*RetentionPeriod_, *proto.mutable_retention_period ());
28662875 }
2876+ }
28672877
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 ;
28702893 }
28712894}
28722895
0 commit comments