Documentation
¶
Index ¶
- type ClientStream
- type RegionSyncer
- func (s *RegionSyncer) GetAllDownstreamNames() []string
- func (s *RegionSyncer) IsRunning() bool
- func (s *RegionSyncer) RunServer(ctx context.Context, regionNotifier <-chan *core.RegionInfo)
- func (s *RegionSyncer) StartSyncWithLeader(addr string)
- func (s *RegionSyncer) StopSyncWithLeader()
- func (s *RegionSyncer) Sync(ctx context.Context, stream pdpb.PD_SyncRegionsServer) error
- type Server
- type ServerStream
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 ¶
func (s *RegionSyncer) Sync(ctx context.Context, 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
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.