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 }
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.
Click to show internal directories.
Click to hide internal directories.