viewservice

package
v0.0.0-...-1bd0170 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DeadPings = 5

the viewserver will declare a client dead if it misses this many Ping RPCs in a row.

View Source
const PingInterval = time.Millisecond * 100

clients should send a Ping RPC this often, to tell the viewservice that the client is alive.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clerk

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

the viewservice Clerk lives in the client and maintains a little state.

func MakeClerk

func MakeClerk(me string, server string) *Clerk

func (*Clerk) Get

func (ck *Clerk) Get() (View, bool)

func (*Clerk) Ping

func (ck *Clerk) Ping(viewnum uint) (View, error)

func (*Clerk) Primary

func (ck *Clerk) Primary() string

type GetArgs

type GetArgs struct {
}

type GetReply

type GetReply struct {
	View View
}

type PingArgs

type PingArgs struct {
	Me      string // "host:port"
	Viewnum uint   // caller's notion of current view #
}

type PingReply

type PingReply struct {
	View View
}

type View

type View struct {
	Viewnum uint
	Primary string
	Backup  string
}

type ViewServer

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

func StartServer

func StartServer(me string) *ViewServer

func (*ViewServer) Get

func (vs *ViewServer) Get(args *GetArgs, reply *GetReply) error

server Get() RPC handler.

func (*ViewServer) GetRPCCount

func (vs *ViewServer) GetRPCCount() int32

please don't change this function.

func (*ViewServer) Kill

func (vs *ViewServer) Kill()

tell the server to shut itself down. for testing. please don't change these two functions.

func (*ViewServer) Ping

func (vs *ViewServer) Ping(args *PingArgs, reply *PingReply) error

server Ping RPC handler.

Jump to

Keyboard shortcuts

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