Documentation
¶
Index ¶
- Variables
- func ChangeIntervalForTest()
- func IsAllISRFullReady(nsInfo *cluster.PartitionMetaInfo) (bool, error)
- func IsRaftNodeFullReady(nsInfo *cluster.PartitionMetaInfo, nid string) (bool, error)
- func IsRaftNodeJoined(nsInfo *cluster.PartitionMetaInfo, nid string) (bool, error)
- type DataPlacement
- type IntHeap
- type PDCoordinator
- func (pdCoord *PDCoordinator) AddHIndexSchema(namespace string, table string, hindex *common.HsetIndexSchema) error
- func (pdCoord *PDCoordinator) AutoBalanceEnabled() bool
- func (pdCoord *PDCoordinator) ChangeNamespaceMetaParam(namespace string, newReplicator int, optimizeFsync string, snapCount int) error
- func (pdCoord *PDCoordinator) CreateNamespace(namespace string, meta cluster.NamespaceMetaInfo) error
- func (pdCoord *PDCoordinator) DelHIndexSchema(namespace string, table string, hindexName string) error
- func (pdCoord *PDCoordinator) DeleteNamespace(ns string, partition string) error
- func (pdCoord *PDCoordinator) GetAllDataNodes() (map[string]cluster.NodeInfo, int64)
- func (pdCoord *PDCoordinator) GetAllNamespaces() (map[string]map[int]cluster.PartitionMetaInfo, int64, error)
- func (pdCoord *PDCoordinator) GetAllPDNodes() ([]cluster.NodeInfo, error)
- func (pdCoord *PDCoordinator) GetPDLeader() cluster.NodeInfo
- func (pdCoord *PDCoordinator) IsClusterStable() bool
- func (pdCoord *PDCoordinator) IsMineLeader() bool
- func (pdCoord *PDCoordinator) MarkNodeAsRemoving(nid string) error
- func (pdCoord *PDCoordinator) RemoveLearnerFromNs(ns string, pidStr string, nid string) error
- func (pdCoord *PDCoordinator) SetBalanceInterval(start, end int)
- func (pdCoord *PDCoordinator) SetClusterStableNodeNum(num int) error
- func (pdCoord *PDCoordinator) SetClusterUpgradeState(upgrading bool) error
- func (pdCoord *PDCoordinator) SetRegister(r cluster.PDRegister)
- func (pdCoord *PDCoordinator) Start() error
- func (pdCoord *PDCoordinator) Stop()
- func (pdCoord *PDCoordinator) SwitchAutoBalance(enable bool)
- type SortableStrings
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAlreadyExist = errors.New("already exist") ErrNotLeader = errors.New("Not leader") ErrClusterUnstable = errors.New("the cluster is unstable") ErrLeaderNodeLost = cluster.NewCoordErr("leader node is lost", cluster.CoordTmpErr) ErrNodeNotFound = cluster.NewCoordErr("node not found", cluster.CoordCommonErr) ErrNamespaceRaftEnough = cluster.NewCoordErr("the namespace isr and catchup nodes are enough", cluster.CoordTmpErr) ErrClusterNodeRemoving = cluster.NewCoordErr("the node is mark as removed", cluster.CoordTmpErr) ErrNamespaceNodeConflict = cluster.NewCoordErr("the namespace node info is conflicted", cluster.CoordClusterErr) ErrNamespaceRaftIDNotFound = cluster.NewCoordErr("the namespace raft id is not found", cluster.CoordClusterErr) ErrNamespaceReplicaNotEnough = cluster.NewCoordErr("the replicas in the namespace is not enough", cluster.CoordTmpErr) ErrNamespaceMigrateWaiting = cluster.NewCoordErr("the migrate is waiting", cluster.CoordTmpErr) )
View Source
var ( ErrClusterBalanceRunning = errors.New("another balance is running, should wait") )
View Source
var (
ErrInvalidSchema = errors.New("invalid schema info")
)
Functions ¶
func ChangeIntervalForTest ¶
func ChangeIntervalForTest()
func IsAllISRFullReady ¶
func IsAllISRFullReady(nsInfo *cluster.PartitionMetaInfo) (bool, error)
query the raft peers if the nid already in the raft group for the namespace and all logs synced in all peers
func IsRaftNodeFullReady ¶
func IsRaftNodeFullReady(nsInfo *cluster.PartitionMetaInfo, nid string) (bool, error)
query the raft peers if the nid already in the raft group for the namespace and all logs synced in all peers
func IsRaftNodeJoined ¶
func IsRaftNodeJoined(nsInfo *cluster.PartitionMetaInfo, nid string) (bool, error)
query the raft peers if the nid already in the raft group for the namespace in all raft peers
Types ¶
type DataPlacement ¶
type DataPlacement struct {
// contains filtered or unexported fields
}
func NewDataPlacement ¶
func NewDataPlacement(coord *PDCoordinator) *DataPlacement
func (*DataPlacement) DoBalance ¶
func (dp *DataPlacement) DoBalance(monitorChan chan struct{})
func (*DataPlacement) SetBalanceInterval ¶
func (dp *DataPlacement) SetBalanceInterval(start int, end int)
type PDCoordinator ¶
type PDCoordinator struct {
// contains filtered or unexported fields
}
func NewPDCoordinator ¶
func (*PDCoordinator) AddHIndexSchema ¶
func (pdCoord *PDCoordinator) AddHIndexSchema(namespace string, table string, hindex *common.HsetIndexSchema) error
func (*PDCoordinator) AutoBalanceEnabled ¶
func (pdCoord *PDCoordinator) AutoBalanceEnabled() bool
func (*PDCoordinator) ChangeNamespaceMetaParam ¶
func (*PDCoordinator) CreateNamespace ¶
func (pdCoord *PDCoordinator) CreateNamespace(namespace string, meta cluster.NamespaceMetaInfo) error
func (*PDCoordinator) DelHIndexSchema ¶
func (pdCoord *PDCoordinator) DelHIndexSchema(namespace string, table string, hindexName string) error
func (*PDCoordinator) DeleteNamespace ¶
func (pdCoord *PDCoordinator) DeleteNamespace(ns string, partition string) error
func (*PDCoordinator) GetAllDataNodes ¶
func (pdCoord *PDCoordinator) GetAllDataNodes() (map[string]cluster.NodeInfo, int64)
func (*PDCoordinator) GetAllNamespaces ¶
func (pdCoord *PDCoordinator) GetAllNamespaces() (map[string]map[int]cluster.PartitionMetaInfo, int64, error)
may return old cached data if register not available
func (*PDCoordinator) GetAllPDNodes ¶
func (pdCoord *PDCoordinator) GetAllPDNodes() ([]cluster.NodeInfo, error)
func (*PDCoordinator) GetPDLeader ¶
func (pdCoord *PDCoordinator) GetPDLeader() cluster.NodeInfo
func (*PDCoordinator) IsClusterStable ¶
func (pdCoord *PDCoordinator) IsClusterStable() bool
some API for outside
func (*PDCoordinator) IsMineLeader ¶
func (pdCoord *PDCoordinator) IsMineLeader() bool
func (*PDCoordinator) MarkNodeAsRemoving ¶
func (pdCoord *PDCoordinator) MarkNodeAsRemoving(nid string) error
func (*PDCoordinator) RemoveLearnerFromNs ¶
func (pdCoord *PDCoordinator) RemoveLearnerFromNs(ns string, pidStr string, nid string) error
func (*PDCoordinator) SetBalanceInterval ¶
func (pdCoord *PDCoordinator) SetBalanceInterval(start, end int)
func (*PDCoordinator) SetClusterStableNodeNum ¶
func (pdCoord *PDCoordinator) SetClusterStableNodeNum(num int) error
func (*PDCoordinator) SetClusterUpgradeState ¶
func (pdCoord *PDCoordinator) SetClusterUpgradeState(upgrading bool) error
func (*PDCoordinator) SetRegister ¶
func (pdCoord *PDCoordinator) SetRegister(r cluster.PDRegister)
func (*PDCoordinator) Start ¶
func (pdCoord *PDCoordinator) Start() error
func (*PDCoordinator) Stop ¶
func (pdCoord *PDCoordinator) Stop()
func (*PDCoordinator) SwitchAutoBalance ¶
func (pdCoord *PDCoordinator) SwitchAutoBalance(enable bool)
type SortableStrings ¶
type SortableStrings []string
func (SortableStrings) Len ¶
func (s SortableStrings) Len() int
func (SortableStrings) Less ¶
func (s SortableStrings) Less(l, r int) bool
func (SortableStrings) Swap ¶
func (s SortableStrings) Swap(l, r int)
Click to show internal directories.
Click to hide internal directories.