consistent

package
v0.0.0-...-70b045a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BigBucket

type BigBucket struct {
	Name    string
	Bucket1 *Bucket // fnv hash 1次
	Bucket2 *Bucket // fnv hash 2次
	Bucket3 *Bucket
}

一个BigBucket对应三个Bucket虚拟节点

type Bucket

type Bucket struct {
	Position uint64
	Big      *BigBucket
}

type ConsistentRing

type ConsistentRing struct {
	Range   uint64
	Buckets []Bucket
}

func (*ConsistentRing) AddNode

func (c *ConsistentRing) AddNode(name string)

支持BigBucket

func (ConsistentRing) DumpNodesRange

func (c ConsistentRing) DumpNodesRange() ConsistentRing

支持BigBucket

func (ConsistentRing) FindBigBucketByKey

func (c ConsistentRing) FindBigBucketByKey(key string) (b BigBucket)

func (ConsistentRing) FindBucketByKey

func (c ConsistentRing) FindBucketByKey(key string) (b Bucket)

func (ConsistentRing) Len

func (a ConsistentRing) Len() int

func (ConsistentRing) Less

func (a ConsistentRing) Less(i, j int) bool

func (ConsistentRing) Swap

func (a ConsistentRing) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL