syncer

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: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientStream

type ClientStream interface {
	Recv() (*pdpb.SyncRegionResponse, error)
	CloseSend() error
}

ClientStream is the client side of the region syncer.

type RegionSyncer

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

RegionSyncer is used to sync the region information without raft.

func NewRegionSyncer

func NewRegionSyncer(s Server) *RegionSyncer

NewRegionSyncer returns a region syncer. The final consistency is ensured by the heartbeat. Strong consistency is not guaranteed. Usually open the region syncer in huge cluster and the server no longer etcd but go-leveldb.

func (*RegionSyncer) RunServer

func (s *RegionSyncer) RunServer(regionNotifier <-chan *core.RegionInfo, quit chan struct{})

RunServer runs the server of the region syncer. regionNotifier is used to get the changed regions.

func (*RegionSyncer) StartSyncWithLeader

func (s *RegionSyncer) StartSyncWithLeader(addr string)

StartSyncWithLeader starts to sync with leader.

func (*RegionSyncer) StopSyncWithLeader

func (s *RegionSyncer) StopSyncWithLeader()

StopSyncWithLeader stop to sync the region with leader.

func (*RegionSyncer) Sync

func (s *RegionSyncer) Sync(stream pdpb.PD_SyncRegionsServer) error

Sync firstly tries to sync the history records to client. then to sync the latest records.

type Server

type Server interface {
	LoopContext() context.Context
	ClusterID() uint64
	GetMemberInfo() *pdpb.Member
	GetLeader() *pdpb.Member
	GetStorage() *core.Storage
	Name() string
	GetRegions() []*core.RegionInfo
	GetSecurityConfig() *grpcutil.SecurityConfig
	GetBasicCluster() *core.BasicCluster
}

Server is the abstraction of the syncer storage server.

type ServerStream

type ServerStream interface {
	Send(regions *pdpb.SyncRegionResponse) error
}

ServerStream is the server side of the region syncer.

Jump to

Keyboard shortcuts

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