cluster

package
v0.0.0-...-d287805 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultReplFactor = 3
)

Variables

This section is empty.

Functions

func New

func New(conf *Config, l *logrus.Logger) (*cluster, error)

func PartitionKey

func PartitionKey(end time.Time, metricHash uint64) uint64

Types

type Cluster

type Cluster interface {
	HashRing() hashring.HashRing
	LocalNode() *Node
	Nodes() Nodes
	NodesByPartitionKey(uint64) Nodes
	ReplicationFactor() int
}

type Config

type Config struct {
	HTTPAdvertiseAddr   net.TCPAddr
	HTTPBindAddr        net.TCPAddr
	GossipAdvertiseAddr net.TCPAddr
	GossipBindAddr      net.TCPAddr
	Peers               []string
	ReplicationFactor   int
}

type Membership

type Membership interface {
	LocalNode() *Node
	Nodes() Nodes
}

type Node

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

func (*Node) Addr

func (n *Node) Addr() string

func (*Node) HTTPAddr

func (n *Node) HTTPAddr() (string, error)

func (*Node) Name

func (n *Node) Name() string

func (*Node) String

func (n *Node) String() string

type Nodes

type Nodes []*Node

func (Nodes) Len

func (nodes Nodes) Len() int

func (Nodes) Less

func (nodes Nodes) Less(i, j int) bool

func (Nodes) Swap

func (nodes Nodes) Swap(i, j int)

Jump to

Keyboard shortcuts

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