Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultNamespace = "global"
DefaultNamespace is the namespace all the store and region belong to by default.
Variables ¶
View Source
var DefaultClassifier = defaultClassifier{}
DefaultClassifier is a classifier that classifies all regions and stores to DefaultNamespace.
Functions ¶
func RegisterClassifier ¶
func RegisterClassifier(name string, createFn CreateClassifierFunc)
RegisterClassifier binds a classifier creator. It should be called in init() func of a package.
Types ¶
type Classifier ¶
type Classifier interface { GetAllNamespaces() []string GetStoreNamespace(*core.StoreInfo) string GetRegionNamespace(*core.RegionInfo) string IsNamespaceExist(name string) bool AllowMerge(*core.RegionInfo, *core.RegionInfo) bool // Reload underlying namespaces ReloadNamespaces() error // These function below are only for tests IsMetaExist() bool IsTableIDExist(int64) bool IsStoreIDExist(uint64) bool }
Classifier is used to determine the namespace which the store or region belongs.
func CreateClassifier ¶
func CreateClassifier(name string, kv *core.KV, idAlloc core.IDAllocator) (Classifier, error)
CreateClassifier creates a namespace classifier with registered creator func.
type CreateClassifierFunc ¶
type CreateClassifierFunc func(*core.KV, core.IDAllocator) (Classifier, error)
CreateClassifierFunc is for creating namespace classifier.
type ScheduleOptions ¶
type ScheduleOptions interface { GetLeaderScheduleLimit(name string) uint64 GetRegionScheduleLimit(name string) uint64 GetReplicaScheduleLimit(name string) uint64 GetMergeScheduleLimit(name string) uint64 GetMaxReplicas(name string) int }
ScheduleOptions for namespace cluster.
Click to show internal directories.
Click to hide internal directories.