coord

package
v0.0.0-...-da8896c Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2015 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STORAGE_RAFT_BUCKET = "conf-raft"
)

Variables

View Source
var ErrCompacted = errors.New("requested index is unavailable due to compaction")
View Source
var ErrSnapOutOfDate = errors.New("requested index is older than the existing snapshot")
View Source
var ErrUnavailable = errors.New("requested entry at index is unavailable")

Functions

func RegisterServer

func RegisterServer(s *grpc.Server)

Types

type BoltStorage

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

func CreateBoltStorage

func CreateBoltStorage(fileName string) (*BoltStorage, error)

func (*BoltStorage) Append

func (b *BoltStorage) Append(entries []pb.Entry) error

func (*BoltStorage) ApplySnapshot

func (b *BoltStorage) ApplySnapshot(snap pb.Snapshot) error

func (*BoltStorage) Compact

func (b *BoltStorage) Compact(cIndex uint64) error

func (*BoltStorage) CreateSnapshot

func (b *BoltStorage) CreateSnapshot(i uint64, cs *pb.ConfState, data []byte) (pb.Snapshot, error)

func (*BoltStorage) Entries

func (b *BoltStorage) Entries(lo, hi uint64) ([]pb.Entry, error)

func (*BoltStorage) FirstIndex

func (b *BoltStorage) FirstIndex() (uint64, error)

func (*BoltStorage) GetNodeId

func (b *BoltStorage) GetNodeId() uint64

func (*BoltStorage) InitialState

func (b *BoltStorage) InitialState() (pb.HardState, pb.ConfState, error)

func (*BoltStorage) LastIndex

func (b *BoltStorage) LastIndex() (uint64, error)

func (*BoltStorage) SetHardState

func (b *BoltStorage) SetHardState(st pb.HardState) error

func (*BoltStorage) SetNodeId

func (b *BoltStorage) SetNodeId(id uint64) error

func (*BoltStorage) Snapshot

func (b *BoltStorage) Snapshot() (pb.Snapshot, error)

func (*BoltStorage) Term

func (b *BoltStorage) Term(i uint64) (uint64, error)

type Hub

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

func NewHub

func NewHub(receivedChan chan *raftpb.Message) *Hub

func (*Hub) AddClient

func (h *Hub) AddClient(id uint64, c *grpc.ClientConn)

func (*Hub) AddServerStream

func (h *Hub) AddServerStream(id uint64, ss pb.Coordinate_EmitRaftStepServer)

func (*Hub) Remove

func (h *Hub) Remove(id uint64)

func (*Hub) SendMessage

func (h *Hub) SendMessage(msg *raftpb.Message)

type Node

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

func NewNode

func NewNode(s *BoltStorage, peers []raft.Peer) *Node

func (*Node) GetMessageChan

func (n *Node) GetMessageChan() chan *raftpb.Message

type RaftSender

type RaftSender interface {
	Send(*pb.RaftStep) error
}

type Task

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

type TaskRunner

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

func NewTaskRunner

func NewTaskRunner() *TaskRunner

Directories

Path Synopsis
Package coord is a generated protocol buffer package.
Package coord is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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