Documentation ¶
Index ¶
- Constants
- type Server
- type Shard
- type WAL
- func (self *WAL) AssignSequenceNumbersAndLog(request *protocol.Request, shard Shard) (uint32, error)
- func (self *WAL) Close() error
- func (self *WAL) Commit(requestNumber uint32, serverId uint32) error
- func (self *WAL) RecoverServerFromLastCommit(serverId uint32, shardIds []uint32, ...) error
- func (self *WAL) RecoverServerFromRequestNumber(requestNumber uint32, shardIds []uint32, ...) error
- func (self *WAL) SetServerId(id uint32)
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 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) RecoverServerFromLastCommit ¶
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 ¶
Click to show internal directories.
Click to hide internal directories.