cluster

package
v0.0.0-...-060dca9 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// &Command{}
	CmdAdd uint = iota
	CmdSub

	// &NetKvStore{}
	NetAdd
	NetRem

	// &HealthEvent{}
	PutHealth
)
View Source
const Magic uint = 0xcafedead

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Op     uint
	Node   string
	Bucket []byte
}

func (*Command) Finished

func (c *Command) Finished()

func (*Command) Invalidates

func (c *Command) Invalidates(b memberlist.Broadcast) bool

func (*Command) Message

func (c *Command) Message() []byte

type Deleg

type Deleg struct {
	Self string
	Meta *Metadata
	TLQ  memberlist.TransmitLimitedQueue
	ML   *memberlist.Memberlist
	NM   globmap.NodeMap
	BM   bucketmap.BucketMap
	HM   healthmap.HealthMap
	NKV  netkv.NetKVMap

	Dist DistanceMeter
	// contains filtered or unexported fields
}

func (*Deleg) AddBucket

func (d *Deleg) AddBucket(name []byte, buck bucketmap.Bucket)

After calling, the 'name' array must no be modified.

func (*Deleg) AddJoinListener

func (d *Deleg) AddJoinListener(f func(string))

func (*Deleg) AddLeaveListener

func (d *Deleg) AddLeaveListener(f func(string))

func (*Deleg) DeleteBucket

func (d *Deleg) DeleteBucket(name []byte)

After calling, the 'name' array must no be modified.

func (*Deleg) GetAll

func (d *Deleg) GetAll(nodes []string, appndTo []*NodeMetadata) []*NodeMetadata

----

func (*Deleg) GetBroadcasts

func (d *Deleg) GetBroadcasts(overhead, limit int) [][]byte

func (*Deleg) GetOne

func (d *Deleg) GetOne(node string) *NodeMetadata

func (*Deleg) Init

func (d *Deleg) Init()

func (*Deleg) IssueHealth

func (d *Deleg) IssueHealth(h healthmap.Health)

----

func (*Deleg) LocalState

func (*Deleg) LocalState(join bool) []byte

func (*Deleg) MergeRemoteState

func (*Deleg) MergeRemoteState(buf []byte, join bool)

func (*Deleg) NodeMeta

func (d *Deleg) NodeMeta(limit int) []byte

func (*Deleg) NotifyAlive

func (d *Deleg) NotifyAlive(peer *memberlist.Node) error

func (*Deleg) NotifyJoin

func (d *Deleg) NotifyJoin(n *memberlist.Node)

func (*Deleg) NotifyLeave

func (d *Deleg) NotifyLeave(n *memberlist.Node)

func (*Deleg) NotifyMerge

func (d *Deleg) NotifyMerge(peers []*memberlist.Node) error

func (*Deleg) NotifyMsg

func (d *Deleg) NotifyMsg(msg []byte)

func (*Deleg) NotifyUpdate

func (d *Deleg) NotifyUpdate(n *memberlist.Node)

func (*Deleg) OfferNetKvStore

func (d *Deleg) OfferNetKvStore(n *NetKvStore)

After calling, the *NetKvStore data structure and all buffers used by it must not be used.

func (*Deleg) SortNodesDistance

func (d *Deleg) SortNodesDistance(s []*NodeMetadata)

type DistanceMeter

type DistanceMeter interface {
	Distance(l, r string) int
}

type HealthEvent

type HealthEvent healthmap.Health

func (HealthEvent) Finished

func (c HealthEvent) Finished()

func (HealthEvent) Invalidates

func (c HealthEvent) Invalidates(b memberlist.Broadcast) bool

func (HealthEvent) Message

func (c HealthEvent) Message() []byte

type Metadata

type Metadata struct {
	Loc  string `msgpack:loc`
	Port int    `msgpack:rpc`
}

func (*Metadata) String

func (m *Metadata) String() string

type NetKvStore

type NetKvStore struct {
	// NetAdd,NetRem
	Op           uint
	Prov, Loc    string
	Bucket, Meta []byte
}

func (*NetKvStore) Finished

func (c *NetKvStore) Finished()

func (*NetKvStore) Invalidates

func (c *NetKvStore) Invalidates(b memberlist.Broadcast) bool

func (*NetKvStore) Message

func (c *NetKvStore) Message() []byte

type NodeMetadata

type NodeMetadata struct {
	Name string
	IP   net.IP
	Metadata
	// contains filtered or unexported fields
}

func (*NodeMetadata) String

func (m *NodeMetadata) String() string

Directories

Path Synopsis
Bucket-Scheduler.
Bucket-Scheduler.

Jump to

Keyboard shortcuts

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