Documentation ¶
Index ¶
- type CaptureTopologyCfg
- type Manager
- func (m *Manager) AddDefaultUpstream(pdEndpoints []string, conf *security.Credential, pdClient pd.Client, ...) (*Upstream, error)
- func (m *Manager) AddUpstream(info *model.UpstreamInfo) *Upstream
- func (m *Manager) Close()
- func (m *Manager) Get(upstreamID uint64) (*Upstream, bool)
- func (m *Manager) GetDefaultUpstream() (*Upstream, error)
- func (m *Manager) Tick(ctx context.Context, globalState *orchestrator.GlobalReactorState) error
- func (m *Manager) Visit(visitor func(up *Upstream) error) error
- type Upstream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CaptureTopologyCfg ¶
type CaptureTopologyCfg struct { *model.CaptureInfo // GCServiceID identify the cdc cluster gc service id GCServiceID string SessionTTL int64 }
CaptureTopologyCfg stores the information of the capture topology.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages all upstream.
func NewManager ¶
func NewManager(ctx context.Context, cfg CaptureTopologyCfg) *Manager
NewManager creates a new Manager. ctx will be used to initialize upstream spawned by this Manager.
func NewManager4Test ¶
NewManager4Test returns a Manager for unit test.
func (*Manager) AddDefaultUpstream ¶
func (m *Manager) AddDefaultUpstream( pdEndpoints []string, conf *security.Credential, pdClient pd.Client, etcdClient *etcd.Client, ) (*Upstream, error)
AddDefaultUpstream add the default upstream
func (*Manager) AddUpstream ¶
func (m *Manager) AddUpstream(info *model.UpstreamInfo) *Upstream
AddUpstream adds an upstream and init it.
func (*Manager) Close ¶
func (m *Manager) Close()
Close closes all upstreams. Please make sure it will only be called once when capture exits.
func (*Manager) GetDefaultUpstream ¶
GetDefaultUpstream returns the default upstream
func (*Manager) Tick ¶
func (m *Manager) Tick(ctx context.Context, globalState *orchestrator.GlobalReactorState, ) error
Tick checks and frees upstream that have not been used for a long time to save resources. It's a thread-safe method.
type Upstream ¶
type Upstream struct { ID uint64 PdEndpoints []string SecurityConfig *security.Credential PDClient pd.Client KVStorage tidbkv.Storage RegionCache *tikv.RegionCache PDClock pdutil.Clock GCManager gc.Manager // contains filtered or unexported fields }
Upstream holds resources of a TiDB cluster, it can be shared by many changefeeds and processors. All public fields and method of an upstream should be thread-safe. Please be careful that never change any exported field of an Upstream.
func NewUpstream4Test ¶
NewUpstream4Test new an upstream for unit test.
func (*Upstream) VerifyTiDBUser ¶
VerifyTiDBUser verify whether the username and password are valid in TiDB. It does the validation via the successfully build of a connection with upstream TiDB with the username and password.