pbservice

package module
v0.0.0-...-1abfb02 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OK             = "OK"
	ErrNoKey       = "ErrNoKey"
	ErrWrongServer = "ErrWrongServer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BootstrapArgs

type BootstrapArgs struct {
	Database map[string]string
	HashVals map[int64]bool
}

Your RPC definitions here.

type BootstrapReply

type BootstrapReply struct {
	Err Err
}

type Clerk

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

func MakeClerk

func MakeClerk(vshost string, me string) *Clerk

func (*Clerk) Append

func (ck *Clerk) Append(key string, value string)

tell the primary to append to key's value. must keep trying until it succeeds.

func (*Clerk) Get

func (ck *Clerk) Get(key string) string

fetch a key's value from the current primary; if they key has never been set, return "". Get() must keep trying until it either the primary replies with the value or the primary says the key doesn't exist (has never been Put().

func (*Clerk) Put

func (ck *Clerk) Put(key string, value string)

tell the primary to update key's value. must keep trying until it succeeds.

func (*Clerk) PutAppend

func (ck *Clerk) PutAppend(key string, value string, op string)

send a Put or Append RPC

type Err

type Err string

type GetArgs

type GetArgs struct {
	Key string
}

type GetReply

type GetReply struct {
	Err   Err
	Value string
}

type GetSyncArgs

type GetSyncArgs struct {
	Key string
	// You'll have to add definitions here.
	Primary string
}

type GetSyncReply

type GetSyncReply struct {
	Err   Err
	Value string
}

type PBServer

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

func StartServer

func StartServer(vshost string, me string) *PBServer

func (*PBServer) Bootstrapped

func (pb *PBServer) Bootstrapped(args *BootstrapArgs, reply *BootstrapReply) error

edited by Adrian the new backup got bootstrapped.

func (*PBServer) Bootstrapping

func (pb *PBServer) Bootstrapping(backup string) error

edited by Adrian initiate by the primary when it found that it's time to bootstrap the new backup since that the current view has not yet changed. so we cannot use `pb.currview.Backup` instead, we pass in a backup param

func (*PBServer) Forward

func (pb *PBServer) Forward(sargs *PutAppendSyncArgs, sreply *PutAppendSyncReply) error

edited by Adrian to leverage determinism of the state machine forward any state necessary for backup to `mimic` the execution do exactly the same PutAppend request on the backup

func (*PBServer) ForwardGet

func (pb *PBServer) ForwardGet(sargs *GetSyncArgs, sreply *GetSyncReply) error

edited by Adrian to leverage determinism of the state machine the backup got a Get request forwarded by the primary

func (*PBServer) Get

func (pb *PBServer) Get(args *GetArgs, reply *GetReply) error

func (*PBServer) PutAppend

func (pb *PBServer) PutAppend(args *PutAppendArgs, reply *PutAppendReply) error

func (*PBServer) Update

func (pb *PBServer) Update(key string, value string, op string, hashVal int64)

edited by Adrian

type PutAppendArgs

type PutAppendArgs struct {
	Key   string
	Value string
	// You'll have to add definitions here.
	// Field names must start with capital letters,
	// otherwise RPC will break.
	Op      string
	HashVal int64
}

Put or Append

type PutAppendReply

type PutAppendReply struct {
	Err Err
}

type PutAppendSyncArgs

type PutAppendSyncArgs struct {
	Key   string
	Value string
	// You'll have to add definitions here.
	// Field names must start with capital letters,
	// otherwise RPC will break.
	Op      string
	HashVal int64
	Primary string
}

Put or Append

type PutAppendSyncReply

type PutAppendSyncReply struct {
	Err Err
}

Jump to

Keyboard shortcuts

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