Documentation ¶
Index ¶
- Variables
- func GenerateConsistentRing(nodeId int32, partIndex int) uint32
- func Int32(bytes []byte) int32
- func Int32Of(str string) int32
- func Int64(bytes []byte) int64
- func Int64Of(str string) int64
- func Remainder(dat []byte, size int) int
- func UInt32Of(str string) uint32
- func UInt64(bytes []byte) uint64
- func UInt64Of(str string) uint64
- func Uint32(bytes []byte) uint32
- type Consistent
- func (p *Consistent) Add(node *Node) bool
- func (p *Consistent) Distribution()
- func (p *Consistent) Get(key string) Node
- func (p *Consistent) GetNodeByRing(ring int) Node
- func (p *Consistent) GetRing(key string) int
- func (p *Consistent) Next(key string, size int) []Node
- func (p *Consistent) NextOfRing(ring uint32) uint32
- func (p *Consistent) NextPartition(nodeId int32, partition int, size int) []Node
- func (p *Consistent) NextRing(key string) int
- func (p *Consistent) Prev(key string, size int) []Node
- func (p *Consistent) PrevRing(key string) int
- func (p *Consistent) PrintMaps()
- func (p *Consistent) PrintRings()
- func (p *Consistent) Remove(node *Node)
- type HashRing
- type Node
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //CRC64_Table_DEFAULT = crc64.MakeTable(crc64.ISO) CRC64_Table_DEFAULT = crc64.MakeTable(crc64.ECMA) )
Functions ¶
func GenerateConsistentRing ¶
Types ¶
type Consistent ¶
type Consistent struct { Nodes map[uint32]Node Resources map[int32]bool sync.RWMutex // contains filtered or unexported fields }
func NewConsistent ¶
func NewConsistent() *Consistent
func (*Consistent) Add ¶
func (p *Consistent) Add(node *Node) bool
func (*Consistent) Distribution ¶
func (p *Consistent) Distribution()
func (*Consistent) Get ¶
func (p *Consistent) Get(key string) Node
func (*Consistent) GetNodeByRing ¶
func (p *Consistent) GetNodeByRing(ring int) Node
func (*Consistent) GetRing ¶
func (p *Consistent) GetRing(key string) int
func (*Consistent) NextOfRing ¶
func (p *Consistent) NextOfRing(ring uint32) uint32
func (*Consistent) NextPartition ¶
func (p *Consistent) NextPartition(nodeId int32, partition int, size int) []Node
func (*Consistent) NextRing ¶
func (p *Consistent) NextRing(key string) int
func (*Consistent) PrevRing ¶
func (p *Consistent) PrevRing(key string) int
func (*Consistent) PrintMaps ¶
func (p *Consistent) PrintMaps()
func (*Consistent) PrintRings ¶
func (p *Consistent) PrintRings()
func (*Consistent) Remove ¶
func (p *Consistent) Remove(node *Node)
Click to show internal directories.
Click to hide internal directories.