github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/cdc/owner/feed_state.go (about) 1 // Copyright 2023 PingCAP, Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // See the License for the specific language governing permissions and 12 // limitations under the License. 13 14 package owner 15 16 import "github.com/pingcap/tiflow/cdc/model" 17 18 // ChangefeedState is the interface for changefeed state in underlying storage. 19 type ChangefeedState interface { 20 // GetID returns the changefeed ID. 21 GetID() model.ChangeFeedID 22 // GetChangefeedInfo returns the changefeed info. 23 GetChangefeedInfo() *model.ChangeFeedInfo 24 // GetChangefeedStatus returns the changefeed status. 25 GetChangefeedStatus() *model.ChangeFeedStatus 26 // RemoveChangefeed removes the changefeed and clean the information and status. 27 RemoveChangefeed() 28 // ResumeChnagefeed resumes the changefeed and set the checkpoint ts. 29 ResumeChnagefeed(uint64) 30 // SetWarning sets the warning to changefeed 31 SetWarning(*model.RunningError) 32 // TakeProcessorWarnings reuturns the warning of the changefeed and clean the warning. 33 TakeProcessorWarnings() []*model.RunningError 34 // SetError sets the error to changefeed 35 SetError(*model.RunningError) 36 // TakeProcessorErrors reuturns the error of the changefeed and clean the error. 37 TakeProcessorErrors() []*model.RunningError 38 // CleanUpTaskPositions removes the task positions of the changefeed. 39 CleanUpTaskPositions() 40 // UpdateChangefeedState returns the task status of the changefeed. 41 UpdateChangefeedState(model.FeedState, model.AdminJobType, uint64) 42 }