xhashring

package
v0.0.0-...-04a5bd4 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HRF_Subscriber = 1 << iota
	HRF_Member
)
View Source
const (
	MH_HrRoute = 0x20000 + iota
)
View Source
const (
	MT_HashRingFlags = 0x20000 | iota
)
View Source
const (
	RTF_Last = 1 << iota
)

Route-Flags

Variables

This section is empty.

Functions

func BecomeMember

func BecomeMember(wn *mlst.WrapNode)

Types

type Entry

type Entry struct {
	Name, Hash string
	// contains filtered or unexported fields
}

func (*Entry) String

func (e *Entry) String() string

type Subscriber

type Subscriber struct {
	Tab  Table
	Num  int // Replication Factor
	Node *mlst.WrapNode
}

func (*Subscriber) Attach

func (s *Subscriber) Attach(wn *mlst.WrapNode)

func (*Subscriber) CheckSelf

func (s *Subscriber) CheckSelf(head *avl.Node) bool

func (*Subscriber) HrRoute

func (s *Subscriber) HrRoute(w *mlst.WrapNode, d *mlst.MessageReader, msg bufferex.Binary) bool

func (*Subscriber) NotifyJoin

func (s *Subscriber) NotifyJoin(node *memberlist.Node)

func (*Subscriber) NotifyLeave

func (s *Subscriber) NotifyLeave(node *memberlist.Node)

func (*Subscriber) NotifyUpdate

func (s *Subscriber) NotifyUpdate(node *memberlist.Node)

type Table

type Table struct {
	HashFunc func(string) string

	NodeDeath time.Duration
	// contains filtered or unexported fields
}

func (*Table) Cleanup

func (t *Table) Cleanup()

func (*Table) Debug_Dump

func (t *Table) Debug_Dump()

func (*Table) Init

func (t *Table) Init()

func (*Table) Invalidate

func (t *Table) Invalidate(name string)

A node, with the hashring extension enabled turns off the hashring extension.

On nodes, with the hashring extension already turned off, this has no effect.

func (*Table) Join

func (t *Table) Join(name string)

A node, with the hashring extension enabled joins the cluster.

func (*Table) Leave

func (t *Table) Leave(name string)

A node, with the hashring extension enabled leaves the cluster (Death).

func (*Table) Left

func (t *Table) Left() *avl.Node

func (*Table) Next

func (t *Table) Next(id string) (node *avl.Node)

func (*Table) NextOrEqual

func (t *Table) NextOrEqual(id string) (node *avl.Node)

func (*Table) Prev

func (t *Table) Prev(id string) (node *avl.Node)

func (*Table) PrevOrEqual

func (t *Table) PrevOrEqual(id string) (node *avl.Node)

func (*Table) Step

func (t *Table) Step(to *avl.Node) *avl.Node

func (*Table) StepReverse

func (t *Table) StepReverse(to *avl.Node) *avl.Node

func (*Table) Validate

func (t *Table) Validate(name string)

A node turns on the hashring extension.

On nodes, with the hashring extension already turned on, this has no effect.

Jump to

Keyboard shortcuts

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