store

package
v0.0.0-...-3e5f7a9 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2017 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRaftNode

func NewRaftNode(id int, peers []string, joined bool, generateSnapshot func() ([]byte, error)) (proposeC chan string, confChangeC chan raftpb.ConfChange, commitC chan<- *string, errorC chan<- error, snapshotterReady <-chan *snap.Snapshotter)

NewRaftNode - ======== NewRaftNode() ======== NewRaftNode initializes a raft instance and returns a committed log entry channel and error channel. Proposals for log updates are sent over the provided the proposal channel. All log entries are replayed over the commit channel, followed by a nil message (to indicate the channel is current), then new log entries. To shutdown, close proposeC and read errorC. func NewRaftNode(id int, peers []string, joined bool, generateSnapshot func() ([]byte, error), proposeC <-chan string, confChangeC <-chan raftpb.ConfChange) (commitC chan<- *string, errorC chan<- error, snapshotterReady <-chan *snap.Snapshotter) {

Types

type Cluster

type Cluster struct {
	DataCenters []*DataCenter
}

**************** Cluster ****************

func (*Cluster) GetWritableVolumes

func (this *Cluster) GetWritableVolumes() (volume *haystack.Volume, err error)

type DataCenter

type DataCenter struct {
	Racks []*Rack
}

**************** DataCenter ****************

type Dataer

type Dataer interface {
	Init() (err error)
	Close()
}

type Host

type Host struct {
	Name string
	IP   string
}

**************** Rack ****************

type Indexer

type Indexer interface {
	Close()
}

type Rack

type Rack struct {
	Hosts []*Host
}

**************** Rack ****************

type RaftNode

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

RaftNode ******************************** Distributed node backed by raft.

func (*RaftNode) GenerateSnapshot

func (_this *RaftNode) GenerateSnapshot(data interface{}) ([]byte, error)

GenerateSnapshot () ======== RaftNode::GenerateSnapshot() ========

func (*RaftNode) IsIDRemoved

func (_this *RaftNode) IsIDRemoved(id uint64) bool

IsIDRemoved - ======== RaftNode::IsIDRemoved() ========

func (*RaftNode) Process

func (_this *RaftNode) Process(ctx context.Context, m raftpb.Message) error

Process - ======== RaftNode::Process() ========

func (*RaftNode) Propose

func (_this *RaftNode) Propose(data interface{}) (err error)

Propose () ======== RaftNode::Propose() ========

func (*RaftNode) ProposeConfChange

func (_this *RaftNode) ProposeConfChange(confChangeType raftpb.ConfChangeType, nodeID uint64, url []byte) (err error)

ProposeConfChange () ======== ProposeConfChange() ========

func (*RaftNode) ReadCommits

func (_this *RaftNode) ReadCommits(commitC <-chan *string, errorC <-chan error, data interface{})

ReadCommits () ======== RaftNode::ReadCommits() ========

func (*RaftNode) RecoverFromSnapshot

func (_this *RaftNode) RecoverFromSnapshot(snapshot []byte, data interface{}) error

RecoverFromSnapshot () ======== RaftNode::RecoverFromSnapshot() ========

func (*RaftNode) ReportSnapshot

func (_this *RaftNode) ReportSnapshot(id uint64, status raft.SnapshotStatus)

ReportSnapshot - ======== RaftNode()::ReportSnapshot() ========

func (*RaftNode) ReportUnreachable

func (_this *RaftNode) ReportUnreachable(id uint64)

ReportUnreachable - ======== RaftNode::ReportUnreachable() ========

type StoppableListener

type StoppableListener struct {
	*net.TCPListener
	// contains filtered or unexported fields
}

StoppableListener - **************** StoppableListener ****************

func NewStoppableListener

func NewStoppableListener(addr string, stopc <-chan struct{}) (*StoppableListener, error)

NewStoppableListener - ======== NewStoppableListener() ========

func (*StoppableListener) Accept

func (_this *StoppableListener) Accept() (conn net.Conn, err error)

Accept - ======== StoppableListener::Accept() ========

type Storer

type Storer interface {
	Init() (err error)
	GetVolumer(vid int32) (*Volumer, bool)
	NewVolumer(vid int32, dir string) *Volumer
}

type Volumer

type Volumer interface {
	NewDataer(vid int32, dir string) *Dataer
	NewIndexer(vid int32, dir string) *Indexer
	Close()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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