Documentation ¶
Index ¶
- Constants
- Variables
- func CheckPDVersion(opt *config.PersistOptions)
- func LogPDInfo()
- func NewTestMultiConfig(c *check.C, count int) []*config.Config
- func NewTestServer(c *check.C) (*Server, CleanupFunc, error)
- func NewTestSingleConfig(c *check.C) *config.Config
- func PrintConfigCheckMsg(cfg *config.Config)
- func PrintPDInfo()
- func StartMonitor(ctx context.Context, now func() time.Time, systimeErrHandler func())
- type CleanupFunc
- type Handler
- func (h *Handler) AddAddLearnerOperator(regionID uint64, toStoreID uint64) error
- func (h *Handler) AddAddPeerOperator(regionID uint64, toStoreID uint64) error
- func (h *Handler) AddAdjacentRegionScheduler(args ...string) error
- func (h *Handler) AddBalanceHotRegionScheduler() error
- func (h *Handler) AddBalanceLeaderScheduler() error
- func (h *Handler) AddBalanceRegionScheduler() error
- func (h *Handler) AddEvictLeaderScheduler(storeID uint64) error
- func (h *Handler) AddGrantLeaderScheduler(storeID uint64) error
- func (h *Handler) AddLabelScheduler() error
- func (h *Handler) AddMergeRegionOperator(regionID uint64, targetID uint64) error
- func (h *Handler) AddRandomMergeScheduler() error
- func (h *Handler) AddRemovePeerOperator(regionID uint64, fromStoreID uint64) error
- func (h *Handler) AddScatterRangeScheduler(args ...string) error
- func (h *Handler) AddScatterRegionOperator(regionID uint64) error
- func (h *Handler) AddScheduler(name string, args ...string) error
- func (h *Handler) AddShuffleHotRegionScheduler(limit uint64) error
- func (h *Handler) AddShuffleLeaderScheduler() error
- func (h *Handler) AddShuffleRegionScheduler() error
- func (h *Handler) AddSplitRegionOperator(regionID uint64, policyStr string, keys []string) error
- func (h *Handler) AddTransferLeaderOperator(regionID uint64, storeID uint64) error
- func (h *Handler) AddTransferPeerOperator(regionID uint64, fromStoreID, toStoreID uint64) error
- func (h *Handler) AddTransferRegionOperator(regionID uint64, storeIDs map[uint64]struct{}) error
- func (h *Handler) GetAddr() string
- func (h *Handler) GetAdminOperators() ([]*operator.Operator, error)
- func (h *Handler) GetAllStoresLimit(limitType storelimit.Type) (map[uint64]*storelimit.StoreLimit, error)
- func (h *Handler) GetDownPeerRegions() ([]*core.RegionInfo, error)
- func (h *Handler) GetEmptyRegion() ([]*core.RegionInfo, error)
- func (h *Handler) GetExtraPeerRegions() ([]*core.RegionInfo, error)
- func (h *Handler) GetHistory(start time.Time) ([]operator.OpHistory, error)
- func (h *Handler) GetHotBytesReadStores() map[uint64]float64
- func (h *Handler) GetHotBytesWriteStores() map[uint64]float64
- func (h *Handler) GetHotKeysReadStores() map[uint64]float64
- func (h *Handler) GetHotKeysWriteStores() map[uint64]float64
- func (h *Handler) GetHotReadRegions() *statistics.StoreHotPeersInfos
- func (h *Handler) GetHotWriteRegions() *statistics.StoreHotPeersInfos
- func (h *Handler) GetLeaderOperators() ([]*operator.Operator, error)
- func (h *Handler) GetMissPeerRegions() ([]*core.RegionInfo, error)
- func (h *Handler) GetOfflinePeer() ([]*core.RegionInfo, error)
- func (h *Handler) GetOperator(regionID uint64) (*operator.Operator, error)
- func (h *Handler) GetOperatorController() (*schedule.OperatorController, error)
- func (h *Handler) GetOperatorStatus(regionID uint64) (*schedule.OperatorWithStatus, error)
- func (h *Handler) GetOperators() ([]*operator.Operator, error)
- func (h *Handler) GetOperatorsOfKind(mask operator.OpKind) ([]*operator.Operator, error)
- func (h *Handler) GetPendingPeerRegions() ([]*core.RegionInfo, error)
- func (h *Handler) GetRaftCluster() (*cluster.RaftCluster, error)
- func (h *Handler) GetRegionOperators() ([]*operator.Operator, error)
- func (h *Handler) GetScheduleConfig() *config.ScheduleConfig
- func (h *Handler) GetSchedulerConfigHandler() http.Handler
- func (h *Handler) GetSchedulers() ([]string, error)
- func (h *Handler) GetStoreLimitScene(limitType storelimit.Type) *storelimit.Scene
- func (h *Handler) GetStores() ([]*core.StoreInfo, error)
- func (h *Handler) GetWaitingOperators() ([]*operator.Operator, error)
- func (h *Handler) IsSchedulerPaused(name string) (bool, error)
- func (h *Handler) PauseOrResumeScheduler(name string, t int64) error
- func (h *Handler) PluginLoad(pluginPath string) error
- func (h *Handler) PluginUnload(pluginPath string) error
- func (h *Handler) RemoveOperator(regionID uint64) error
- func (h *Handler) RemoveScheduler(name string) error
- func (h *Handler) ResetTS(ts uint64) error
- func (h *Handler) SetAllStoresLimit(rate float64, limitType storelimit.Type) error
- func (h *Handler) SetStoreLimit(storeID uint64, rate float64, limitType storelimit.Type) error
- func (h *Handler) SetStoreLimitScene(scene *storelimit.Scene, limitType storelimit.Type)
- type HandlerBuilder
- type Server
- func (s *Server) AddCloseCallback(callbacks ...func())
- func (s *Server) AddStartCallback(callbacks ...func())
- func (s *Server) AllocID(ctx context.Context, request *pdpb.AllocIDRequest) (*pdpb.AllocIDResponse, error)
- func (s *Server) AskBatchSplit(ctx context.Context, request *pdpb.AskBatchSplitRequest) (*pdpb.AskBatchSplitResponse, error)
- func (s *Server) AskSplit(ctx context.Context, request *pdpb.AskSplitRequest) (*pdpb.AskSplitResponse, error)
- func (s *Server) Bootstrap(ctx context.Context, request *pdpb.BootstrapRequest) (*pdpb.BootstrapResponse, error)
- func (s *Server) Close()
- func (s *Server) ClusterID() uint64
- func (s *Server) Context() context.Context
- func (s *Server) DeleteLabelProperty(typ, labelKey, labelValue string) error
- func (s *Server) GetAddr() string
- func (s *Server) GetAllStores(ctx context.Context, request *pdpb.GetAllStoresRequest) (*pdpb.GetAllStoresResponse, error)
- func (s *Server) GetAllocator() *id.AllocatorImpl
- func (s *Server) GetBasicCluster() *core.BasicCluster
- func (s *Server) GetClient() *clientv3.Client
- func (s *Server) GetCluster() *metapb.Cluster
- func (s *Server) GetClusterConfig(ctx context.Context, request *pdpb.GetClusterConfigRequest) (*pdpb.GetClusterConfigResponse, error)
- func (s *Server) GetClusterRootPath() string
- func (s *Server) GetClusterStatus() (*cluster.Status, error)
- func (s *Server) GetClusterVersion() semver.Version
- func (s *Server) GetConfig() *config.Config
- func (s *Server) GetEndpoints() []string
- func (s *Server) GetGCSafePoint(ctx context.Context, request *pdpb.GetGCSafePointRequest) (*pdpb.GetGCSafePointResponse, error)
- func (s *Server) GetHBStreams() opt.HeartbeatStreams
- func (s *Server) GetHTTPClient() *http.Client
- func (s *Server) GetHandler() *Handler
- func (s *Server) GetLabelProperty() config.LabelPropertyConfig
- func (s *Server) GetLeader() *pdpb.Member
- func (s *Server) GetMember() *member.Member
- func (s *Server) GetMemberInfo() *pdpb.Member
- func (s *Server) GetMembers(context.Context, *pdpb.GetMembersRequest) (*pdpb.GetMembersResponse, error)
- func (s *Server) GetMetaRegions() []*metapb.Region
- func (s *Server) GetOperator(ctx context.Context, request *pdpb.GetOperatorRequest) (*pdpb.GetOperatorResponse, error)
- func (s *Server) GetPDServerConfig() *config.PDServerConfig
- func (s *Server) GetPersistOptions() *config.PersistOptions
- func (s *Server) GetPrevRegion(ctx context.Context, request *pdpb.GetRegionRequest) (*pdpb.GetRegionResponse, error)
- func (s *Server) GetRaftCluster() *cluster.RaftCluster
- func (s *Server) GetRegion(ctx context.Context, request *pdpb.GetRegionRequest) (*pdpb.GetRegionResponse, error)
- func (s *Server) GetRegionByID(ctx context.Context, request *pdpb.GetRegionByIDRequest) (*pdpb.GetRegionResponse, error)
- func (s *Server) GetRegions() []*core.RegionInfo
- func (s *Server) GetReplicationConfig() *config.ReplicationConfig
- func (s *Server) GetReplicationModeConfig() *config.ReplicationModeConfig
- func (s *Server) GetScheduleConfig() *config.ScheduleConfig
- func (s *Server) GetSecurityConfig() *grpcutil.SecurityConfig
- func (s *Server) GetServerOption() *config.PersistOptions
- func (s *Server) GetStorage() *core.Storage
- func (s *Server) GetStore(ctx context.Context, request *pdpb.GetStoreRequest) (*pdpb.GetStoreResponse, error)
- func (s *Server) IsBootstrapped(ctx context.Context, request *pdpb.IsBootstrappedRequest) (*pdpb.IsBootstrappedResponse, error)
- func (s *Server) IsClosed() bool
- func (s *Server) LoopContext() context.Context
- func (s *Server) Name() string
- func (s *Server) PersistFile(name string, data []byte) error
- func (s *Server) PutClusterConfig(ctx context.Context, request *pdpb.PutClusterConfigRequest) (*pdpb.PutClusterConfigResponse, error)
- func (s *Server) PutStore(ctx context.Context, request *pdpb.PutStoreRequest) (*pdpb.PutStoreResponse, error)
- func (s *Server) RegionHeartbeat(stream pdpb.PD_RegionHeartbeatServer) error
- func (s *Server) ReplicateFileToAllMembers(ctx context.Context, name string, data []byte) error
- func (s *Server) ReportBatchSplit(ctx context.Context, request *pdpb.ReportBatchSplitRequest) (*pdpb.ReportBatchSplitResponse, error)
- func (s *Server) ReportSplit(ctx context.Context, request *pdpb.ReportSplitRequest) (*pdpb.ReportSplitResponse, error)
- func (s *Server) Run() error
- func (s *Server) ScanRegions(ctx context.Context, request *pdpb.ScanRegionsRequest) (*pdpb.ScanRegionsResponse, error)
- func (s *Server) ScatterRegion(ctx context.Context, request *pdpb.ScatterRegionRequest) (*pdpb.ScatterRegionResponse, error)
- func (s *Server) SetClusterVersion(v string) error
- func (s *Server) SetLabelProperty(typ, labelKey, labelValue string) error
- func (s *Server) SetLabelPropertyConfig(cfg config.LabelPropertyConfig) error
- func (s *Server) SetLogLevel(level string) error
- func (s *Server) SetPDServerConfig(cfg config.PDServerConfig) error
- func (s *Server) SetReplicationConfig(cfg config.ReplicationConfig) error
- func (s *Server) SetReplicationModeConfig(cfg config.ReplicationModeConfig) error
- func (s *Server) SetScheduleConfig(cfg config.ScheduleConfig) error
- func (s *Server) SetStorage(storage *core.Storage)
- func (s *Server) StartTimestamp() int64
- func (s *Server) StoreHeartbeat(ctx context.Context, request *pdpb.StoreHeartbeatRequest) (*pdpb.StoreHeartbeatResponse, error)
- func (s *Server) SyncRegions(stream pdpb.PD_SyncRegionsServer) error
- func (s *Server) Tso(stream pdpb.PD_TsoServer) error
- func (s *Server) UpdateGCSafePoint(ctx context.Context, request *pdpb.UpdateGCSafePointRequest) (*pdpb.UpdateGCSafePointResponse, error)
- func (s *Server) UpdateServiceGCSafePoint(ctx context.Context, request *pdpb.UpdateServiceGCSafePointRequest) (*pdpb.UpdateServiceGCSafePointResponse, error)
- type ServiceGroup
Constants ¶
const ( // CorePath the core group, is at REST path `/pd/api/v1`. CorePath = "/pd/api/v1" // ExtensionsPath the named groups are REST at `/pd/apis/{GROUP_NAME}/{Version}`. ExtensionsPath = "/pd/apis" )
Variables ¶
var ( // ErrNotLeader is returned when current server is not the leader and not possible to process request. // TODO: work as proxy. ErrNotLeader = status.Errorf(codes.Unavailable, "not leader") ErrNotStarted = status.Errorf(codes.Unavailable, "server not started") )
gRPC errors
var ( // SchedulerConfigHandlerPath is the api router path of the schedule config handler. SchedulerConfigHandlerPath = "/api/v1/scheduler-config" // ErrServerNotStarted is error info for server not started. ErrServerNotStarted = errors.New("The server has not been started") // ErrOperatorNotFound is error info for operator not found. ErrOperatorNotFound = errors.New("operator not found") // ErrAddOperator is error info for already have an operator when adding operator. ErrAddOperator = errors.New("failed to add operator, maybe already have one") // ErrRegionNotAdjacent is error info for region not adjacent. ErrRegionNotAdjacent = errors.New("two regions are not adjacent") // ErrRegionNotFound is error info for region not found. ErrRegionNotFound = func(regionID uint64) error { return errors.Errorf("region %v not found", regionID) } // ErrRegionAbnormalPeer is error info for region has abonormal peer. ErrRegionAbnormalPeer = func(regionID uint64) error { return errors.Errorf("region %v has abnormal peer", regionID) } // ErrStoreNotFound is error info for store not found. ErrStoreNotFound = func(storeID uint64) error { return errors.Errorf("store %v not found", storeID) } // ErrPluginNotFound is error info for plugin not found. ErrPluginNotFound = func(pluginPath string) error { return errors.Errorf("plugin is not found: %s", pluginPath) } )
var ( // EnableZap enable the zap logger in embed etcd. EnableZap = false // EtcdStartTimeout the timeout of the startup etcd. EtcdStartTimeout = time.Minute * 5 )
var ( PDReleaseVersion = "None" PDBuildTS = "None" PDGitHash = "None" PDGitBranch = "None" PDEdition = "None" )
Version information.
Functions ¶
func CheckPDVersion ¶
func CheckPDVersion(opt *config.PersistOptions)
CheckPDVersion checks if PD needs to be upgraded.
func NewTestMultiConfig ¶
NewTestMultiConfig is only for test to create multiple pd configurations. Because PD client also needs this, so export here.
func NewTestServer ¶
func NewTestServer(c *check.C) (*Server, CleanupFunc, error)
NewTestServer creates a pd server for testing.
func NewTestSingleConfig ¶
NewTestSingleConfig is only for test to create one pd. Because PD client also needs this, so export here.
func PrintConfigCheckMsg ¶
PrintConfigCheckMsg prints the message about configuration checks.
func PrintPDInfo ¶
func PrintPDInfo()
PrintPDInfo prints the PD version information without log info.
Types ¶
type CleanupFunc ¶
type CleanupFunc func()
CleanupFunc closes test pd server(s) and deletes any files left behind.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a helper to export methods to handle API/RPC requests.
func (*Handler) AddAddLearnerOperator ¶
AddAddLearnerOperator adds an operator to add learner.
func (*Handler) AddAddPeerOperator ¶
AddAddPeerOperator adds an operator to add peer.
func (*Handler) AddAdjacentRegionScheduler ¶
AddAdjacentRegionScheduler adds a balance-adjacent-region-scheduler.
func (*Handler) AddBalanceHotRegionScheduler ¶
AddBalanceHotRegionScheduler adds a balance-hot-region-scheduler.
func (*Handler) AddBalanceLeaderScheduler ¶
AddBalanceLeaderScheduler adds a balance-leader-scheduler.
func (*Handler) AddBalanceRegionScheduler ¶
AddBalanceRegionScheduler adds a balance-region-scheduler.
func (*Handler) AddEvictLeaderScheduler ¶
AddEvictLeaderScheduler adds an evict-leader-scheduler.
func (*Handler) AddGrantLeaderScheduler ¶
AddGrantLeaderScheduler adds a grant-leader-scheduler.
func (*Handler) AddLabelScheduler ¶
AddLabelScheduler adds a label-scheduler.
func (*Handler) AddMergeRegionOperator ¶
AddMergeRegionOperator adds an operator to merge region.
func (*Handler) AddRandomMergeScheduler ¶
AddRandomMergeScheduler adds a random-merge-scheduler.
func (*Handler) AddRemovePeerOperator ¶
AddRemovePeerOperator adds an operator to remove peer.
func (*Handler) AddScatterRangeScheduler ¶
AddScatterRangeScheduler adds a balance-range-leader-scheduler
func (*Handler) AddScatterRegionOperator ¶
AddScatterRegionOperator adds an operator to scatter a region.
func (*Handler) AddScheduler ¶
AddScheduler adds a scheduler.
func (*Handler) AddShuffleHotRegionScheduler ¶
AddShuffleHotRegionScheduler adds a shuffle-hot-region-scheduler.
func (*Handler) AddShuffleLeaderScheduler ¶
AddShuffleLeaderScheduler adds a shuffle-leader-scheduler.
func (*Handler) AddShuffleRegionScheduler ¶
AddShuffleRegionScheduler adds a shuffle-region-scheduler.
func (*Handler) AddSplitRegionOperator ¶
AddSplitRegionOperator adds an operator to split a region.
func (*Handler) AddTransferLeaderOperator ¶
AddTransferLeaderOperator adds an operator to transfer leader to the store.
func (*Handler) AddTransferPeerOperator ¶
AddTransferPeerOperator adds an operator to transfer peer.
func (*Handler) AddTransferRegionOperator ¶
AddTransferRegionOperator adds an operator to transfer region to the stores.
func (*Handler) GetAdminOperators ¶
GetAdminOperators returns the running admin operators.
func (*Handler) GetAllStoresLimit ¶
func (h *Handler) GetAllStoresLimit(limitType storelimit.Type) (map[uint64]*storelimit.StoreLimit, error)
GetAllStoresLimit is used to get limit of all stores.
func (*Handler) GetDownPeerRegions ¶
func (h *Handler) GetDownPeerRegions() ([]*core.RegionInfo, error)
GetDownPeerRegions gets the region with down peer.
func (*Handler) GetEmptyRegion ¶
func (h *Handler) GetEmptyRegion() ([]*core.RegionInfo, error)
GetEmptyRegion gets the region with empty size.
func (*Handler) GetExtraPeerRegions ¶
func (h *Handler) GetExtraPeerRegions() ([]*core.RegionInfo, error)
GetExtraPeerRegions gets the region exceeds the specified number of peers.
func (*Handler) GetHistory ¶
GetHistory returns finished operators' history since start.
func (*Handler) GetHotBytesReadStores ¶
GetHotBytesReadStores gets all hot write stores stats.
func (*Handler) GetHotBytesWriteStores ¶
GetHotBytesWriteStores gets all hot write stores stats.
func (*Handler) GetHotKeysReadStores ¶
GetHotKeysReadStores gets all hot write stores stats.
func (*Handler) GetHotKeysWriteStores ¶
GetHotKeysWriteStores gets all hot write stores stats.
func (*Handler) GetHotReadRegions ¶
func (h *Handler) GetHotReadRegions() *statistics.StoreHotPeersInfos
GetHotReadRegions gets all hot read regions stats.
func (*Handler) GetHotWriteRegions ¶
func (h *Handler) GetHotWriteRegions() *statistics.StoreHotPeersInfos
GetHotWriteRegions gets all hot write regions stats.
func (*Handler) GetLeaderOperators ¶
GetLeaderOperators returns the running leader operators.
func (*Handler) GetMissPeerRegions ¶
func (h *Handler) GetMissPeerRegions() ([]*core.RegionInfo, error)
GetMissPeerRegions gets the region less than the specified number of peers.
func (*Handler) GetOfflinePeer ¶
func (h *Handler) GetOfflinePeer() ([]*core.RegionInfo, error)
GetOfflinePeer gets the region with offline peer.
func (*Handler) GetOperator ¶
GetOperator returns the region operator.
func (*Handler) GetOperatorController ¶
func (h *Handler) GetOperatorController() (*schedule.OperatorController, error)
GetOperatorController returns OperatorController.
func (*Handler) GetOperatorStatus ¶
func (h *Handler) GetOperatorStatus(regionID uint64) (*schedule.OperatorWithStatus, error)
GetOperatorStatus returns the status of the region operator.
func (*Handler) GetOperators ¶
GetOperators returns the running operators.
func (*Handler) GetOperatorsOfKind ¶
GetOperatorsOfKind returns the running operators of the kind.
func (*Handler) GetPendingPeerRegions ¶
func (h *Handler) GetPendingPeerRegions() ([]*core.RegionInfo, error)
GetPendingPeerRegions gets the region with pending peer.
func (*Handler) GetRaftCluster ¶
func (h *Handler) GetRaftCluster() (*cluster.RaftCluster, error)
GetRaftCluster returns RaftCluster.
func (*Handler) GetRegionOperators ¶
GetRegionOperators returns the running region operators.
func (*Handler) GetScheduleConfig ¶
func (h *Handler) GetScheduleConfig() *config.ScheduleConfig
GetScheduleConfig returns ScheduleConfig.
func (*Handler) GetSchedulerConfigHandler ¶
GetSchedulerConfigHandler gets the handler of schedulers.
func (*Handler) GetSchedulers ¶
GetSchedulers returns all names of schedulers.
func (*Handler) GetStoreLimitScene ¶
func (h *Handler) GetStoreLimitScene(limitType storelimit.Type) *storelimit.Scene
GetStoreLimitScene returns the limit valus for different scenes
func (*Handler) GetWaitingOperators ¶
GetWaitingOperators returns the waiting operators.
func (*Handler) IsSchedulerPaused ¶
IsSchedulerPaused returns whether scheduler is paused.
func (*Handler) PauseOrResumeScheduler ¶
PauseOrResumeScheduler pasues a scheduler for delay seconds or resume a paused scheduler. t == 0 : resume scheduler. t > 0 : scheduler delays t seconds.
func (*Handler) PluginLoad ¶
PluginLoad loads the plugin referenced by the pluginPath
func (*Handler) PluginUnload ¶
PluginUnload unloads the plugin referenced by the pluginPath
func (*Handler) RemoveOperator ¶
RemoveOperator removes the region operator.
func (*Handler) RemoveScheduler ¶
RemoveScheduler removes a scheduler by name.
func (*Handler) SetAllStoresLimit ¶
func (h *Handler) SetAllStoresLimit(rate float64, limitType storelimit.Type) error
SetAllStoresLimit is used to set limit of all stores.
func (*Handler) SetStoreLimit ¶
SetStoreLimit is used to set the limit of a store.
func (*Handler) SetStoreLimitScene ¶
func (h *Handler) SetStoreLimitScene(scene *storelimit.Scene, limitType storelimit.Type)
SetStoreLimitScene sets the limit values for differents scenes
type HandlerBuilder ¶
HandlerBuilder builds a server HTTP handler.
type Server ¶
type Server struct { diagnosticspb.DiagnosticsServer // contains filtered or unexported fields }
Server is the pd server.
func CreateServer ¶
func CreateServer(ctx context.Context, cfg *config.Config, serviceBuilders ...HandlerBuilder) (*Server, error)
CreateServer creates the UNINITIALIZED pd server with given configuration.
func (*Server) AddCloseCallback ¶
func (s *Server) AddCloseCallback(callbacks ...func())
AddCloseCallback adds a callback in the Close phase.
func (*Server) AddStartCallback ¶
func (s *Server) AddStartCallback(callbacks ...func())
AddStartCallback adds a callback in the startServer phase.
func (*Server) AllocID ¶
func (s *Server) AllocID(ctx context.Context, request *pdpb.AllocIDRequest) (*pdpb.AllocIDResponse, error)
AllocID implements gRPC PDServer.
func (*Server) AskBatchSplit ¶
func (s *Server) AskBatchSplit(ctx context.Context, request *pdpb.AskBatchSplitRequest) (*pdpb.AskBatchSplitResponse, error)
AskBatchSplit implements gRPC PDServer.
func (*Server) AskSplit ¶
func (s *Server) AskSplit(ctx context.Context, request *pdpb.AskSplitRequest) (*pdpb.AskSplitResponse, error)
AskSplit implements gRPC PDServer.
func (*Server) Bootstrap ¶
func (s *Server) Bootstrap(ctx context.Context, request *pdpb.BootstrapRequest) (*pdpb.BootstrapResponse, error)
Bootstrap implements gRPC PDServer.
func (*Server) DeleteLabelProperty ¶
DeleteLabelProperty deletes a label property config.
func (*Server) GetAllStores ¶
func (s *Server) GetAllStores(ctx context.Context, request *pdpb.GetAllStoresRequest) (*pdpb.GetAllStoresResponse, error)
GetAllStores implements gRPC PDServer.
func (*Server) GetAllocator ¶
func (s *Server) GetAllocator() *id.AllocatorImpl
GetAllocator returns the ID allocator of server.
func (*Server) GetBasicCluster ¶
func (s *Server) GetBasicCluster() *core.BasicCluster
GetBasicCluster returns the basic cluster of server.
func (*Server) GetClusterConfig ¶
func (s *Server) GetClusterConfig(ctx context.Context, request *pdpb.GetClusterConfigRequest) (*pdpb.GetClusterConfigResponse, error)
GetClusterConfig implements gRPC PDServer.
func (*Server) GetClusterRootPath ¶
GetClusterRootPath returns the cluster root path.
func (*Server) GetClusterStatus ¶
GetClusterStatus gets cluster status.
func (*Server) GetClusterVersion ¶
GetClusterVersion returns the version of cluster.
func (*Server) GetEndpoints ¶
GetEndpoints returns the etcd endpoints for outer use.
func (*Server) GetGCSafePoint ¶
func (s *Server) GetGCSafePoint(ctx context.Context, request *pdpb.GetGCSafePointRequest) (*pdpb.GetGCSafePointResponse, error)
GetGCSafePoint implements gRPC PDServer.
func (*Server) GetHBStreams ¶
func (s *Server) GetHBStreams() opt.HeartbeatStreams
GetHBStreams returns the heartbeat streams.
func (*Server) GetHTTPClient ¶
GetHTTPClient returns builtin etcd client.
func (*Server) GetHandler ¶
GetHandler returns the handler for API.
func (*Server) GetLabelProperty ¶
func (s *Server) GetLabelProperty() config.LabelPropertyConfig
GetLabelProperty returns the whole label property config.
func (*Server) GetMemberInfo ¶
GetMemberInfo returns the server member information.
func (*Server) GetMembers ¶
func (s *Server) GetMembers(context.Context, *pdpb.GetMembersRequest) (*pdpb.GetMembersResponse, error)
GetMembers implements gRPC PDServer.
func (*Server) GetMetaRegions ¶
GetMetaRegions gets meta regions from cluster.
func (*Server) GetOperator ¶
func (s *Server) GetOperator(ctx context.Context, request *pdpb.GetOperatorRequest) (*pdpb.GetOperatorResponse, error)
GetOperator gets information about the operator belonging to the speicfy region.
func (*Server) GetPDServerConfig ¶
func (s *Server) GetPDServerConfig() *config.PDServerConfig
GetPDServerConfig gets the balance config information.
func (*Server) GetPersistOptions ¶
func (s *Server) GetPersistOptions() *config.PersistOptions
GetPersistOptions returns the schedule option.
func (*Server) GetPrevRegion ¶
func (s *Server) GetPrevRegion(ctx context.Context, request *pdpb.GetRegionRequest) (*pdpb.GetRegionResponse, error)
GetPrevRegion implements gRPC PDServer
func (*Server) GetRaftCluster ¶
func (s *Server) GetRaftCluster() *cluster.RaftCluster
GetRaftCluster gets Raft cluster. If cluster has not been bootstrapped, return nil.
func (*Server) GetRegion ¶
func (s *Server) GetRegion(ctx context.Context, request *pdpb.GetRegionRequest) (*pdpb.GetRegionResponse, error)
GetRegion implements gRPC PDServer.
func (*Server) GetRegionByID ¶
func (s *Server) GetRegionByID(ctx context.Context, request *pdpb.GetRegionByIDRequest) (*pdpb.GetRegionResponse, error)
GetRegionByID implements gRPC PDServer.
func (*Server) GetRegions ¶
func (s *Server) GetRegions() []*core.RegionInfo
GetRegions gets regions from cluster.
func (*Server) GetReplicationConfig ¶
func (s *Server) GetReplicationConfig() *config.ReplicationConfig
GetReplicationConfig get the replication config.
func (*Server) GetReplicationModeConfig ¶
func (s *Server) GetReplicationModeConfig() *config.ReplicationModeConfig
GetReplicationModeConfig returns the replication mode config.
func (*Server) GetScheduleConfig ¶
func (s *Server) GetScheduleConfig() *config.ScheduleConfig
GetScheduleConfig gets the balance config information.
func (*Server) GetSecurityConfig ¶
func (s *Server) GetSecurityConfig() *grpcutil.SecurityConfig
GetSecurityConfig get the security config.
func (*Server) GetServerOption ¶
func (s *Server) GetServerOption() *config.PersistOptions
GetServerOption gets the option of the server.
func (*Server) GetStorage ¶
GetStorage returns the backend storage of server.
func (*Server) GetStore ¶
func (s *Server) GetStore(ctx context.Context, request *pdpb.GetStoreRequest) (*pdpb.GetStoreResponse, error)
GetStore implements gRPC PDServer.
func (*Server) IsBootstrapped ¶
func (s *Server) IsBootstrapped(ctx context.Context, request *pdpb.IsBootstrappedRequest) (*pdpb.IsBootstrappedResponse, error)
IsBootstrapped implements gRPC PDServer.
func (*Server) LoopContext ¶
LoopContext returns the loop context of server.
func (*Server) PersistFile ¶
PersistFile saves a file in DataDir.
func (*Server) PutClusterConfig ¶
func (s *Server) PutClusterConfig(ctx context.Context, request *pdpb.PutClusterConfigRequest) (*pdpb.PutClusterConfigResponse, error)
PutClusterConfig implements gRPC PDServer.
func (*Server) PutStore ¶
func (s *Server) PutStore(ctx context.Context, request *pdpb.PutStoreRequest) (*pdpb.PutStoreResponse, error)
PutStore implements gRPC PDServer.
func (*Server) RegionHeartbeat ¶
func (s *Server) RegionHeartbeat(stream pdpb.PD_RegionHeartbeatServer) error
RegionHeartbeat implements gRPC PDServer.
func (*Server) ReplicateFileToAllMembers ¶
ReplicateFileToAllMembers is used to synchronize state among all members. Each member will write `data` to a local file named `name`.
func (*Server) ReportBatchSplit ¶
func (s *Server) ReportBatchSplit(ctx context.Context, request *pdpb.ReportBatchSplitRequest) (*pdpb.ReportBatchSplitResponse, error)
ReportBatchSplit implements gRPC PDServer.
func (*Server) ReportSplit ¶
func (s *Server) ReportSplit(ctx context.Context, request *pdpb.ReportSplitRequest) (*pdpb.ReportSplitResponse, error)
ReportSplit implements gRPC PDServer.
func (*Server) ScanRegions ¶
func (s *Server) ScanRegions(ctx context.Context, request *pdpb.ScanRegionsRequest) (*pdpb.ScanRegionsResponse, error)
ScanRegions implements gRPC PDServer.
func (*Server) ScatterRegion ¶
func (s *Server) ScatterRegion(ctx context.Context, request *pdpb.ScatterRegionRequest) (*pdpb.ScatterRegionResponse, error)
ScatterRegion implements gRPC PDServer.
func (*Server) SetClusterVersion ¶
SetClusterVersion sets the version of cluster.
func (*Server) SetLabelProperty ¶
SetLabelProperty inserts a label property config.
func (*Server) SetLabelPropertyConfig ¶
func (s *Server) SetLabelPropertyConfig(cfg config.LabelPropertyConfig) error
SetLabelPropertyConfig sets the label property config.
func (*Server) SetLogLevel ¶
SetLogLevel sets log level.
func (*Server) SetPDServerConfig ¶
func (s *Server) SetPDServerConfig(cfg config.PDServerConfig) error
SetPDServerConfig sets the server config.
func (*Server) SetReplicationConfig ¶
func (s *Server) SetReplicationConfig(cfg config.ReplicationConfig) error
SetReplicationConfig sets the replication config.
func (*Server) SetReplicationModeConfig ¶
func (s *Server) SetReplicationModeConfig(cfg config.ReplicationModeConfig) error
SetReplicationModeConfig sets the replication mode.
func (*Server) SetScheduleConfig ¶
func (s *Server) SetScheduleConfig(cfg config.ScheduleConfig) error
SetScheduleConfig sets the balance config information.
func (*Server) SetStorage ¶
SetStorage changes the storage only for test purpose. When we use it, we should prevent calling GetStorage, otherwise, it may cause a data race problem.
func (*Server) StartTimestamp ¶
StartTimestamp returns the start timestamp of this server
func (*Server) StoreHeartbeat ¶
func (s *Server) StoreHeartbeat(ctx context.Context, request *pdpb.StoreHeartbeatRequest) (*pdpb.StoreHeartbeatResponse, error)
StoreHeartbeat implements gRPC PDServer.
func (*Server) SyncRegions ¶
func (s *Server) SyncRegions(stream pdpb.PD_SyncRegionsServer) error
SyncRegions syncs the regions.
func (*Server) Tso ¶
func (s *Server) Tso(stream pdpb.PD_TsoServer) error
Tso implements gRPC PDServer.
func (*Server) UpdateGCSafePoint ¶
func (s *Server) UpdateGCSafePoint(ctx context.Context, request *pdpb.UpdateGCSafePointRequest) (*pdpb.UpdateGCSafePointResponse, error)
UpdateGCSafePoint implements gRPC PDServer.
func (*Server) UpdateServiceGCSafePoint ¶
func (s *Server) UpdateServiceGCSafePoint(ctx context.Context, request *pdpb.UpdateServiceGCSafePointRequest) (*pdpb.UpdateServiceGCSafePointResponse, error)
UpdateServiceGCSafePoint update the safepoint for specific service
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package core defines core characteristics of the server.
|
Package core defines core characteristics of the server. |