syncer

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2025 License: Apache-2.0 Imports: 28 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 that ensures final consistency through the heartbeat, but it does not guarantee strong consistency. Using the same storage backend of the region storage.

func (*RegionSyncer) GetAllDownstreamNames

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

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

func (*RegionSyncer) IsRunning

func (s *RegionSyncer) IsRunning() bool

IsRunning returns whether the region syncer client is running.

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
	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