replication

package
v4.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileReplicater

type FileReplicater interface {
	ReplicateFileToAllMembers(ctx context.Context, name string, data []byte) error
}

FileReplicater is the interface that can save important data to all cluster nodes.

type HTTPReplicationStatus

type HTTPReplicationStatus struct {
	Mode       string `json:"mode"`
	DrAutoSync struct {
		LabelKey        string  `json:"label_key"`
		State           string  `json:"state"`
		StateID         uint64  `json:"state_id,omitempty"`
		TotalRegions    int     `json:"total_regions,omitempty"`
		SyncedRegions   int     `json:"synced_regions,omitempty"`
		RecoverProgress float32 `json:"recover_progress,omitempty"`
	} `json:"dr-auto-sync,omitempty"`
}

HTTPReplicationStatus is for query status from HTTP API.

type ModeManager

type ModeManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

ModeManager is used to control how raft logs are synchronized between different tikv nodes.

func NewReplicationModeManager

func NewReplicationModeManager(config config.ReplicationModeConfig, storage *core.Storage, cluster opt.Cluster, fileReplicater FileReplicater) (*ModeManager, error)

NewReplicationModeManager creates the replicate mode manager.

func (*ModeManager) GetReplicationStatus

func (m *ModeManager) GetReplicationStatus() *pb.ReplicationStatus

GetReplicationStatus returns the status to sync with tikv servers.

func (*ModeManager) GetReplicationStatusHTTP

func (m *ModeManager) GetReplicationStatusHTTP() *HTTPReplicationStatus

GetReplicationStatusHTTP returns status for HTTP API.

func (*ModeManager) Run

func (m *ModeManager) Run(quit chan struct{})

Run starts the background job.

func (*ModeManager) UpdateConfig

func (m *ModeManager) UpdateConfig(config config.ReplicationModeConfig) error

UpdateConfig updates configuration online and updates internal state.

Jump to

Keyboard shortcuts

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