wal

package
v0.5.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2014 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CURRENT_VERSION = 1
)
View Source
const HOST_ID_OFFSET = uint64(10000)

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server interface {
	GetId() uint32
}

type Shard

type Shard interface {
	Id() uint32
}

type WAL

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

func NewWAL

func NewWAL(config *configuration.Configuration) (*WAL, error)

func (*WAL) AssignSequenceNumbersAndLog

func (self *WAL) AssignSequenceNumbersAndLog(request *protocol.Request, shard Shard) (uint32, error)

Will assign sequence numbers if null. Returns a unique id that should be marked as committed for each server as it gets confirmed.

func (*WAL) Close

func (self *WAL) Close() error

func (*WAL) Commit

func (self *WAL) Commit(requestNumber uint32, serverId uint32) error

Marks a given request for a given server as committed

func (*WAL) RecoverServerFromLastCommit

func (self *WAL) RecoverServerFromLastCommit(serverId uint32, shardIds []uint32, yield func(request *protocol.Request, shardId uint32) error) error

func (*WAL) RecoverServerFromRequestNumber

func (self *WAL) RecoverServerFromRequestNumber(requestNumber uint32, shardIds []uint32, yield func(request *protocol.Request, shardId uint32) error) error

In the case where this server is running and another one in the cluster stops responding, at some point this server will have to just write requests to disk. When the downed server comes back up, it's this server's responsibility to send out any writes that were queued up. If the yield function returns nil then the request is committed.

func (*WAL) SetServerId

func (self *WAL) SetServerId(id uint32)

Jump to

Keyboard shortcuts

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