syncer

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: Apache-2.0 Imports: 26 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 {
	// 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) GetAllDownstreamNames

func (s *RegionSyncer) GetAllDownstreamNames() []string

GetAllDownstreamNames tries to get the all bind stream's name. Only for test

func (*RegionSyncer) RunServer

func (s *RegionSyncer) RunServer(ctx context.Context, regionNotifier <-chan *core.RegionInfo)

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

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() storage.Storage
	Name() string
	GetRegions() []*core.RegionInfo
	GetTLSConfig() *grpcutil.TLSConfig
	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