Documentation
¶
Index ¶
- Constants
- type BootstrapArgs
- type BootstrapReply
- type Clerk
- type Err
- type GetArgs
- type GetReply
- type GetSyncArgs
- type GetSyncReply
- type PBServer
- func (pb *PBServer) Bootstrapped(args *BootstrapArgs, reply *BootstrapReply) error
- func (pb *PBServer) Bootstrapping(backup string) error
- func (pb *PBServer) Forward(sargs *PutAppendSyncArgs, sreply *PutAppendSyncReply) error
- func (pb *PBServer) ForwardGet(sargs *GetSyncArgs, sreply *GetSyncReply) error
- func (pb *PBServer) Get(args *GetArgs, reply *GetReply) error
- func (pb *PBServer) PutAppend(args *PutAppendArgs, reply *PutAppendReply) error
- func (pb *PBServer) Update(key string, value string, op string, hashVal int64)
- type PutAppendArgs
- type PutAppendReply
- type PutAppendSyncArgs
- type PutAppendSyncReply
Constants ¶
const ( OK = "OK" ErrNoKey = "ErrNoKey" ErrWrongServer = "ErrWrongServer" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BootstrapArgs ¶
Your RPC definitions here.
type BootstrapReply ¶
type BootstrapReply struct {
Err Err
}
type Clerk ¶
type Clerk struct {
// contains filtered or unexported fields
}
func (*Clerk) Append ¶
tell the primary to append to key's value. must keep trying until it succeeds.
func (*Clerk) Get ¶
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().
type GetSyncArgs ¶
type GetSyncReply ¶
type PBServer ¶
type PBServer struct {
// contains filtered or unexported fields
}
func StartServer ¶
func (*PBServer) Bootstrapped ¶
func (pb *PBServer) Bootstrapped(args *BootstrapArgs, reply *BootstrapReply) error
edited by Adrian the new backup got bootstrapped.
func (*PBServer) Bootstrapping ¶
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) PutAppend ¶
func (pb *PBServer) PutAppend(args *PutAppendArgs, reply *PutAppendReply) error
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
}