cluster

package
v3.11.1-0...-a10bf72 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMemberlist

func NewMemberlist(name, addr string, secret []byte, verbose bool, d delegate) (*memberlist.Memberlist, error)

Types

type DynamicCluster

type DynamicCluster struct {
	// contains filtered or unexported fields
}

DynamicCluster is the struct that handles the gossip based hashring cluster state of telemeter server nodes.

It wraps a store.Store and can be used as a drop-in store replacement to forward collected metrics to the actual target node based on the current hashring state.

func NewDynamic

func NewDynamic(name string, store store.Store) *DynamicCluster

NewDynamic returns a new DynamicCluster struct for the given name and underlying store.

func (*DynamicCluster) GetBroadcasts

func (c *DynamicCluster) GetBroadcasts(overhead, limit int) [][]byte

GetBroadcasts is the callback that is invoked, when user data messages can be broadcast. It is unused.

func (*DynamicCluster) Join

func (c *DynamicCluster) Join(seeds []string) error

Join attempts to join a cluster by contacting all the given seed hosts.

This simply delegates to github.com/hashicorp/memberlist#Memberlist.Join.

func (*DynamicCluster) LocalState

func (c *DynamicCluster) LocalState(join bool) []byte

LocalState is the callback that is invoked for a TCP Push/Pull. It is unused.

func (*DynamicCluster) MergeRemoteState

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

MergeRemoteState is the callback that is invoked after a TCP Push/Pull. It is unused.

func (*DynamicCluster) NodeMeta

func (c *DynamicCluster) NodeMeta(limit int) []byte

NodeMeta is the callback that is invoked when metadata is retrieved about this node. Currently, no metadata is returned.

See github.com/hashicorp/memberlist#Delegate.NodeMeta

func (*DynamicCluster) NotifyJoin

func (c *DynamicCluster) NotifyJoin(node *memberlist.Node)

NotifyJoin is the callback that is invoked when a node is detected to have joined.

See github.com/hashicorp/memberlist#EventDelegate.NotifyJoin

func (*DynamicCluster) NotifyLeave

func (c *DynamicCluster) NotifyLeave(node *memberlist.Node)

NotifyLeave is the callback that is invoked when a node is detected to have left.

See github.com/hashicorp/memberlist#EventDelegate.NotifyLeave

func (*DynamicCluster) NotifyMsg

func (c *DynamicCluster) NotifyMsg(data []byte)

NotifyMsg is the callback that is invoked, when a message is received. Any data received here is enqueued in the message queue and processed asynchronously in the #handleMessage method.

See github.com/hashicorp/memberlist#Delegate.NotifyMsg

func (*DynamicCluster) NotifyUpdate

func (c *DynamicCluster) NotifyUpdate(node *memberlist.Node)

NotifyUpdate is the callback that is invoked when a node to have updated.

See github.com/hashicorp/memberlist#EventDelegate.NotifyUpdate

func (*DynamicCluster) ReadMetrics

func (c *DynamicCluster) ReadMetrics(ctx context.Context, minTimestampMs int64) ([]*store.PartitionedMetrics, error)

ReadMetrics simply forwards to the underlying store.

func (*DynamicCluster) ServeHTTP

func (c *DynamicCluster) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP implements a simple http handler exposing debug info about the cluster state.

func (*DynamicCluster) Start

func (c *DynamicCluster) Start(ml memberlister, ctx context.Context)

Start starts processing the internal message queue until the given context is done.

func (*DynamicCluster) WriteMetrics

func (c *DynamicCluster) WriteMetrics(ctx context.Context, p *store.PartitionedMetrics) error

WriteMetrics stores metrics locally if they were meant for this node and forwards them to the target node matching the given partition key.

Jump to

Keyboard shortcuts

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