Versions in this module Expand all Collapse all v1 v1.0.5 Dec 23, 2019 v1.0.4 Oct 17, 2019 v1.0.3 Oct 12, 2019 v1.0.2 Dec 10, 2018 v1.0.1 Aug 15, 2018 v1.0.0 Aug 9, 2018 Changes in this version + const CONSISTENTLEN + const FeedbackConnectErrDefault + const FeedbackNonConnectErrDefault + const FeedbackNonConnectErrDelete + const FeedbackNonConnectErrSet + const MINKEYS + const QUEUECAP + const RINGLEN + const TIMEINTERVAL + const WAIT_FOR_RETRY + var ErrQueueEmpty = errors.New("queue empty") + var ErrQueueFull = errors.New("queue full") + var ErrWriteFailed = errors.New("write failed") + func InitGlobalManualScheduler(route *dbcfg.RouteTable, n int) + type Bucket struct + ID int + func (bucket *Bucket) GetHosts(key string) (hosts []*Host) + func (bucket *Bucket) ReBalance() + type ByName []*HostInBucket + func (b ByName) Len() int + func (b ByName) Less(i, j int) bool + func (b ByName) Swap(i, j int) + type Feedback struct + type Host struct + Addr string + Index int + func NewHost(addr string) *Host + func (host *Host) Append(key string, value []byte) (bool, error) + func (host *Host) Close() + func (host *Host) Delete(key string) (bool, error) + func (host *Host) Get(key string) (*mc.Item, error) + func (host *Host) GetMulti(keys []string) (map[string]*mc.Item, error) + func (host *Host) Incr(key string, value int) (int, error) + func (host *Host) Len() int + func (host *Host) Process(key string, args []string) (string, string) + func (host *Host) Set(key string, item *mc.Item, noreply bool) (bool, error) + type HostInBucket struct + type ManualScheduler struct + N int + func NewManualScheduler(route *dbcfg.RouteTable, n int) *ManualScheduler + func (sch *ManualScheduler) Close() + func (sch *ManualScheduler) DivideKeysByBucket(keys []string) [][]string + func (sch *ManualScheduler) Feedback(host *Host, key string, startTime time.Time, data float64) + func (sch *ManualScheduler) FeedbackError(host *Host, key string, startTime time.Time, errorCode float64) + func (sch *ManualScheduler) FeedbackLatency(host *Host, key string, startTime time.Time, timeUsed time.Duration) + func (sch *ManualScheduler) GetBucketInfo(bucketID int64) map[string]map[string]map[string][]Response + func (sch *ManualScheduler) GetHostsByKey(key string) (hosts []*Host) + func (sch *ManualScheduler) LatenciesStats() map[string]map[string][QUEUECAP]Response + func (sch *ManualScheduler) Partition() map[string]map[string]int + func (sch *ManualScheduler) Stats() map[string]map[string]float64 + type Partition struct + func NewPartition(count int, nodesNum int) *Partition + type Response struct + Count int + ReqTime time.Time + Sum float64 + type RingQueue struct + func NewRingQueue() *RingQueue + func (q *RingQueue) Get(num, dataType int) (responses []Response) + func (q *RingQueue) Push(start time.Time, ResTime float64, dataType int) error + type Scheduler interface + Close func() + DivideKeysByBucket func(keys []string) [][]string + FeedbackError func(host *Host, key string, startTime time.Time, errorCode float64) + FeedbackLatency func(host *Host, key string, startTime time.Time, timeUsed time.Duration) + GetBucketInfo func(bucketID int64) map[string]map[string]map[string][]Response + GetHostsByKey func(key string) (hosts []*Host) + LatenciesStats func() map[string]map[string][QUEUECAP]Response + Partition func() map[string]map[string]int + Stats func() map[string]map[string]float64 + func GetScheduler() Scheduler + type Storage struct + func (s *Storage) Client() mc.StorageClient + type StorageClient struct + N int + R int + SuccessedTargets []string + W int + func NewStorageClient(n int, w int, r int) (c *StorageClient) + func (c *StorageClient) Append(key string, value []byte) (ok bool, err error) + func (c *StorageClient) Clean() + func (c *StorageClient) Close() + func (c *StorageClient) Delete(key string) (flag bool, err error) + func (c *StorageClient) Get(key string) (item *mc.Item, err error) + func (c *StorageClient) GetMulti(keys []string) (rs map[string]*mc.Item, err error) + func (c *StorageClient) GetSuccessedTargets() []string + func (c *StorageClient) Incr(key string, value int) (result int, err error) + func (c *StorageClient) Len() int + func (c *StorageClient) Process(key string, args []string) (string, string) + func (c *StorageClient) Set(key string, item *mc.Item, noreply bool) (ok bool, err error)