member

package
v0.0.0-...-1d14c1d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitMetrics

func InitMetrics(registry *prometheus.Registry)

InitMetrics registers all metrics used in scheduler

Types

type CaptureChanges

type CaptureChanges struct {
	Init    map[model.CaptureID][]tablepb.TableStatus
	Removed map[model.CaptureID][]tablepb.TableStatus
}

CaptureChanges wraps changes of captures.

type CaptureManager

type CaptureManager struct {
	OwnerRev schedulepb.OwnerRevision
	Captures map[model.CaptureID]*CaptureStatus
	// contains filtered or unexported fields
}

CaptureManager manages capture status.

func NewCaptureManager

func NewCaptureManager(
	ownerID model.CaptureID, changefeedID model.ChangeFeedID,
	rev schedulepb.OwnerRevision, cfg *config.SchedulerConfig,
) *CaptureManager

NewCaptureManager returns a new capture manager.

func (*CaptureManager) CheckAllCaptureInitialized

func (c *CaptureManager) CheckAllCaptureInitialized() bool

CheckAllCaptureInitialized check if all capture is initialized.

func (*CaptureManager) CleanMetrics

func (c *CaptureManager) CleanMetrics()

CleanMetrics cleans metrics.

func (*CaptureManager) CollectMetrics

func (c *CaptureManager) CollectMetrics()

CollectMetrics collects metrics.

func (*CaptureManager) HandleAliveCaptureUpdate

func (c *CaptureManager) HandleAliveCaptureUpdate(
	aliveCaptures map[model.CaptureID]*model.CaptureInfo,
) []*schedulepb.Message

HandleAliveCaptureUpdate update captures liveness.

func (*CaptureManager) HandleMessage

func (c *CaptureManager) HandleMessage(
	msgs []*schedulepb.Message,
)

HandleMessage handles messages sent from other captures.

func (*CaptureManager) SetInitializedForTests

func (c *CaptureManager) SetInitializedForTests(init bool)

SetInitializedForTests is only used in tests.

func (*CaptureManager) TakeChanges

func (c *CaptureManager) TakeChanges() *CaptureChanges

TakeChanges takes the changes of captures that it sees so far.

func (*CaptureManager) Tick

func (c *CaptureManager) Tick(
	reps *spanz.BtreeMap[*replication.ReplicationSet],
	drainingCapture model.CaptureID,
	barrier *schedulepb.Barrier,
) []*schedulepb.Message

Tick advances the logical clock of capture manager and produce heartbeat when necessary.

type CaptureState

type CaptureState int

CaptureState is the state of a capture.

    ┌───────────────┐ Heartbeat Resp ┌─────────────┐
    │ Uninitialized ├───────────────>│ Initialized │
    └──────┬────────┘                └──────┬──────┘
           │                                │
IsStopping │          ┌──────────┐          │ IsStopping
           └────────> │ Stopping │ <────────┘
                      └──────────┘
const (
	// CaptureStateUninitialized means the capture status is unknown,
	// no heartbeat response received yet.
	CaptureStateUninitialized CaptureState = 1
	// CaptureStateInitialized means owner has received heartbeat response.
	CaptureStateInitialized CaptureState = 2
	// CaptureStateStopping means the capture is removing, e.g., shutdown.
	CaptureStateStopping CaptureState = 3
)

func (CaptureState) String

func (s CaptureState) String() string

type CaptureStatus

type CaptureStatus struct {
	OwnerRev schedulepb.OwnerRevision
	Epoch    schedulepb.ProcessorEpoch
	State    CaptureState
	Tables   []tablepb.TableStatus
	ID       model.CaptureID
	Addr     string
	IsOwner  bool
	// contains filtered or unexported fields
}

CaptureStatus represent capture's status.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL