486}
487
488// GetStage gets the stage of the current unsafe recovery.
489func (u *Controller) GetStage() stage { 490 u.RLock()
491 defer u.RUnlock()
492 return u.stage
298}
299
300// NewStoreStatisticsMap creates a new storeStatisticsMap.
301func NewStoreStatisticsMap(opt config.ConfProvider) *storeStatisticsMap {302 return &storeStatisticsMap{
303 opt: opt,
304 stats: newStoreStatistics(opt),
71}
72
73// NewCollectBucketStatsTask creates task to collect bucket stats.
74func NewCollectBucketStatsTask(minDegree int, regionIDs ...uint64) *collectBucketStatsTask {75 return &collectBucketStatsTask{
76 minDegree: minDegree,
77 regionIDs: regionIDs,
48}
49
50// NewEtcdKVBase creates a new etcd kv.
51func NewEtcdKVBase(client *clientv3.Client, rootPath string) *etcdKVBase { 52 return &etcdKVBase{
53 client: client,
54 rootPath: rootPath,
An exported function or method returning a value of an unexported type may be frustrating to use.
In Go, if the function or method starts with a lowercase letter, it is not exported outside the package.
type unexportedType string
func ExportedFunc() *unexportedType {
return &unexportedType("some string")
}
type ExportedType string
func ExportedFunc() *ExportedType {
return &ExportedType("some string")
}