raft

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateTopicOp            = "CreateTopicOp"
	SetPartitionLeaderOp     = "SetPartitionLeader"
	SetPartitionLeaderBulkOp = "SetPartitionLeaderBulkOp"
	AddNode                  = "AddNode"
	DeleteNode               = "DeleteNode"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name          string
	BindAddr      string
	AdvAddr       string
	Dir           string
	StartAsLeader bool
}

type Store

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

func New

func New(conf Config, logger logy.Logger) *Store

func (*Store) AddNode

func (s *Store) AddNode(n *sandglass.Node) error

func (*Store) AddVoter

func (s *Store) AddVoter(id, address string, prevIndex uint64) error

func (*Store) CreateTopic

func (s *Store) CreateTopic(t *topic.Topic) error

func (*Store) GetPartitionLeader

func (s *Store) GetPartitionLeader(topic, partition string) (string, bool)

func (*Store) GetTopic

func (s *Store) GetTopic(name string) *topic.Topic

func (*Store) GetTopics

func (s *Store) GetTopics() []*topic.Topic

func (*Store) Init

func (s *Store) Init(bootstrap bool, serf *serf.Serf, reconcileCh chan serf.Member) error

func (*Store) IsLeader

func (s *Store) IsLeader() bool

func (*Store) Leader

func (s *Store) Leader() string

func (*Store) LeaderCh

func (s *Store) LeaderCh() <-chan bool

func (*Store) NewTopicChan

func (s *Store) NewTopicChan() chan *topic.Topic

func (*Store) RemoveNode

func (s *Store) RemoveNode(n *sandglass.Node) error

func (*Store) RemoveServer

func (s *Store) RemoveServer(id string, prevIndex uint64) error

func (*Store) SetPartitionLeaderBulkOp

func (s *Store) SetPartitionLeaderBulkOp(v map[string]map[string]string) error

func (*Store) SetPartitionLeaderOp

func (s *Store) SetPartitionLeaderOp(topic, partition, leader string) error

func (*Store) Stop

func (s *Store) Stop() error

Jump to

Keyboard shortcuts

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